fix: admin database charset
CI / changes (push) Successful in 1s
CI / docker-bff (push) Successful in 2s
CI / docker-product (push) Failing after 1s

This commit is contained in:
zzw
2026-08-07 16:20:31 +08:00
parent 3b84d201e2
commit 29ffc24bbb
12 changed files with 55 additions and 38 deletions
+4 -4
View File
@@ -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 取