diff --git a/server/resource/internal/logic/logocombinelogic.go b/server/resource/internal/logic/logocombinelogic.go index 3aa07fac..5706bb75 100644 --- a/server/resource/internal/logic/logocombinelogic.go +++ b/server/resource/internal/logic/logocombinelogic.go @@ -49,6 +49,10 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth return resp.SetStatus(basic.CodeUnAuth) } + if req.TemplateId == 0 || req.TemplateTag == "" { + return resp.SetStatus(basic.CodeLogoCombineNoFoundErr, "模版或标签不存在") + } + var userId int64 var guestId int64 @@ -106,7 +110,7 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth }) if err != nil { - return resp.SetStatus(basic.CodeServiceErr, fmt.Sprintf("算法请求--LOGO信息--错误:%+v", err)) + return resp.SetStatus(basic.CodeLogoCombineErr, fmt.Sprintf("算法请求--LOGO信息--错误:%+v", err)) } // 返回成功的响应和上传URL diff --git a/utils/basic/basic.go b/utils/basic/basic.go index 35f17a2b..795f04ba 100644 --- a/utils/basic/basic.go +++ b/utils/basic/basic.go @@ -96,6 +96,9 @@ var ( CodeFileLogoCombineErr = &StatusResponse{5112, "logo upload err"} // 用户合图失败 CodeFileNoFoundErr = &StatusResponse{5113, "file not found err"} // 文件不存在 CodeLogoSetCategory = &StatusResponse{5114, "logo set category fail"} // 文件不存在 + + CodeLogoCombineErr = &StatusResponse{5115, "logo combine fail"} // 合图失败 + CodeLogoCombineNoFoundErr = &StatusResponse{5116, "template record not found"} // 模版不存在 ) type Response struct {