From 1699420c4a9da8bfaa2e7c1cb4e4bbd226a59224 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 12 Sep 2023 15:59:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=90=88=E5=9B=BE,=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/resource/internal/logic/logocombinelogic.go | 6 +++++- utils/basic/basic.go | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) 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 {