fix: admin database charset
This commit is contained in:
@@ -39,14 +39,14 @@ func NewCreateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateLogi
|
||||
func (l *CreateLogic) Create(in *product.CreateReq) (*product.Response, error) {
|
||||
var req validator.ProductCreateValidator
|
||||
if msg := validateService.ValidateFromProto(in, &req); msg != utils.StringEmpty {
|
||||
return msgResponse(utils.Ok.Code, msg), nil
|
||||
return outResponse(utils.ErrorParams, msg), nil
|
||||
}
|
||||
|
||||
if req.Type == dao.ProductTypeNormal {
|
||||
if req.AgentPrice == 0 || req.StorePrice == 0 ||
|
||||
req.SalePrice == 0 || req.SharePrice == 0 ||
|
||||
req.SaleReward == "" {
|
||||
return msgResponse(int32(utils.ErrorMissingParams.GetCode()), "缺少相关价格"), nil
|
||||
return outResponse(utils.ErrorParams, "缺少相关价格"), nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func (l *CreateLogic) Create(in *product.CreateReq) (*product.Response, error) {
|
||||
if len(req.PublishTime) > 1 {
|
||||
t, err := parsePublishTime(req.PublishTime)
|
||||
if err != nil {
|
||||
return msgResponse(int32(utils.ErrorMissingParams.GetCode()), "时间错误"), nil
|
||||
return outResponse(utils.ErrorParams, "时间错误"), nil
|
||||
}
|
||||
publishTime = t
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func (l *CreateLogic) Create(in *product.CreateReq) (*product.Response, error) {
|
||||
return failResponse(utils.Fail), nil
|
||||
}
|
||||
if check.Id > 0 {
|
||||
return failResponse(utils.ErrorDataIsExist), nil
|
||||
return failErr(utils.ErrorDataIsExist), nil
|
||||
}
|
||||
|
||||
// 管理员信息后续从 ctx / metadata 取
|
||||
|
||||
Reference in New Issue
Block a user