新增产品详情api

This commit is contained in:
laodaming
2023-06-05 11:27:01 +08:00
parent a933f0d763
commit f7e7e2d85c
6 changed files with 273 additions and 5 deletions

View File

@@ -0,0 +1,33 @@
package logic
import (
"context"
"fusenapi/utils/auth"
"fusenapi/product/internal/svc"
"fusenapi/product/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type GetProductInfoLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetProductInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductInfoLogic {
return &GetProductInfoLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, loginInfo auth.UserInfo) (resp *types.Response, err error) {
//校验前台登录情况
if loginInfo.UserId == 0 {
return &types.Response{Code: 402, Message: "please sign in"}, nil
}
return
}

View File

@@ -36,7 +36,6 @@ func NewGetProductListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
// 获取产品列表
func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, loginInfo auth.UserInfo) (resp *types.Response, err error) {
loginInfo.UserId = 84
//校验前台登录情况
if loginInfo.UserId == 0 {
return &types.Response{Code: 402, Message: "please sign in"}, nil