This commit is contained in:
laodaming 2023-10-30 16:30:01 +08:00
parent a9bec4c4fd
commit 0c3e93bba6
3 changed files with 5 additions and 5 deletions

View File

@ -51,12 +51,12 @@ func (l *GetTagProductListLogic) GetTagProductList(req *types.GetTagProductListR
Level: 2, //等级是2的 Level: 2, //等级是2的
} }
//传入分类id //传入分类id
if req.Cid > 0 { if req.BasicTagId > 0 {
//获取该类行的levelprefix //获取该类行的levelprefix
tagData, err := l.svcCtx.AllModels.FsTags.FindOne(l.ctx, req.Cid) tagData, err := l.svcCtx.AllModels.FsTags.FindOne(l.ctx, req.BasicTagId)
if err != nil { if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) { if errors.Is(err, gorm.ErrRecordNotFound) {
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "param cid is invalid:record not found") return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "param BasicTagId is invalid:record not found")
} }
logx.Error(err) logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get tag info") return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get tag info")

View File

@ -29,7 +29,7 @@ type GetRecommandProductListRsp struct {
} }
type GetTagProductListReq struct { type GetTagProductListReq struct {
Cid int64 `form:"cid,optional"` //分类id BasicTagId int64 `form:"basic_tag_id,optional"` //传入则以该分类为最高层分类查询
MerchantType int64 `form:"merchant_type,optional"` //商户类型 MerchantType int64 `form:"merchant_type,optional"` //商户类型
TemplateTag string `form:"template_tag,optional"` //模板标签 TemplateTag string `form:"template_tag,optional"` //模板标签
WithProduct bool `form:"with_product,optional"` //是否携带分类下的产品 WithProduct bool `form:"with_product,optional"` //是否携带分类下的产品

View File

@ -72,7 +72,7 @@ type GetRecommandProductListRsp {
} }
//获取分类产品列表 //获取分类产品列表
type GetTagProductListReq { type GetTagProductListReq {
Cid int64 `form:"cid,optional"` //分类id BasicTagId int64 `form:"basic_tag_id,optional"` //传入则以该分类为最高层分类查询
MerchantType int64 `form:"merchant_type,optional"` //商户类型 MerchantType int64 `form:"merchant_type,optional"` //商户类型
TemplateTag string `form:"template_tag,optional"` //模板标签 TemplateTag string `form:"template_tag,optional"` //模板标签
WithProduct bool `form:"with_product,optional"` //是否携带分类下的产品 WithProduct bool `form:"with_product,optional"` //是否携带分类下的产品