Files
51dj_server/app/api/officialWebsitectrl/partner.go
T
2026-10-08 16:50:13 +08:00

30 lines
839 B
Go

package officialWebsitectrl
import (
"91jd-server/app/service/officialWebsiteser"
"91jd-server/common"
"91jd-server/common/cachev2"
"91jd-server/common/constant/redisconst"
"91jd-server/common/stderr"
"github.com/gin-gonic/gin"
)
func PartnerList(ctx *gin.Context) {
req := &officialWebsiteser.PartnerListReq{}
if err := ctx.ShouldBindQuery(req); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
return
}
var data officialWebsiteser.PartnerListResp
_, err := cachev2.Classes().
CacheTime(redisconst.OfficialWebsitePartnerListCacheExpire).
AutoListKey(redisconst.OfficialWebsitePartnerListCacheKey).
ResBind(&data).Cache(officialWebsiteser.PartnerList, req)
if err != nil {
common.ServeJSON(ctx, stderr.ErrDbQueryError, err.Error())
return
}
common.ServeJSON(ctx, stderr.Success, data)
}