This commit is contained in:
laodaming 2023-10-20 10:59:36 +08:00
parent 0c3fe73ce2
commit 4aaf1a1587
3 changed files with 5 additions and 8 deletions

View File

@ -38,7 +38,7 @@ func (l *GetRecommandProductListLogic) GetRecommandProductList(req *types.GetRec
if req.Num > 100 || req.Num < 0 { if req.Num > 100 || req.Num < 0 {
req.Num = 4 req.Num = 4
} }
productInfo, err := l.svcCtx.AllModels.FsProduct.FindOneBySn(l.ctx, req.Sn) productInfo, err := l.svcCtx.AllModels.FsProduct.FindOne(l.ctx, req.ProductId)
if err != nil { if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) { if errors.Is(err, gorm.ErrRecordNotFound) {
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "detail`s product is not found") return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "detail`s product is not found")

View File

@ -7,8 +7,7 @@ import (
type GetRecommandProductListReq struct { type GetRecommandProductListReq struct {
Num int64 `form:"num,optional"` Num int64 `form:"num,optional"`
Size int64 `form:"size"` ProductId int64 `form:"product_id"`
Sn string `form:"sn"`
} }
type GetRecommandProductListRsp struct { type GetRecommandProductListRsp struct {

View File

@ -51,9 +51,7 @@ service product {
//获取详情页推荐产品列表 //获取详情页推荐产品列表
type GetRecommandProductListReq { type GetRecommandProductListReq {
Num int64 `form:"num,optional"` Num int64 `form:"num,optional"`
Size int64 `form:"size"` ProductId int64 `form:"product_id"`
Sn string `form:"sn"`
//ProductId int64 `form:"product_id"`
} }
type GetRecommandProductListRsp { type GetRecommandProductListRsp {
Id int64 `json:"id"` Id int64 `json:"id"`