fusenapi/server/product/internal/logic/getthousandfacedesignbypidlogic.go
laodaming 9e7b3267aa fix
2023-07-17 19:39:35 +08:00

48 lines
1.3 KiB
Go

package logic
import (
"fusenapi/utils/auth"
"fusenapi/utils/basic"
"strings"
"context"
"fusenapi/server/product/internal/svc"
"fusenapi/server/product/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type GetThousandFaceDesignByPidLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetThousandFaceDesignByPidLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetThousandFaceDesignByPidLogic {
return &GetThousandFaceDesignByPidLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetThousandFaceDesignByPidLogic) GetThousandFaceDesignByPid(req *types.GetThousandFaceDesignByPidReq, userinfo *auth.UserInfo) (resp *basic.Response) {
req.Pid = strings.Trim(req.Pid, " ")
if req.Pid == "" {
return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "err param:pid is empty")
}
//获取产品信息(只是获取id)
/* productInfo, err := l.svcCtx.AllModels.FsProduct.FindOneBySn(l.ctx, req.Pid, "id")
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "the product is not exists")
}
logx.Error(err)
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get product info")
}*/
//获取产品设计
return resp.SetStatus(basic.CodeOK)
}