新增产品详情api
This commit is contained in:
33
product/internal/logic/getproductinfologic.go
Normal file
33
product/internal/logic/getproductinfologic.go
Normal 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
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user