fix:请求算法,添加错误提示

This commit is contained in:
momo 2023-08-25 10:08:45 +08:00
parent d003844efd
commit 3cb5ccc937
3 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package logic
import (
"fmt"
"fusenapi/service/repositories"
"fusenapi/utils/auth"
"fusenapi/utils/basic"
@ -70,7 +71,7 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
})
if err != nil {
return resp.SetStatus(basic.CodeServiceErr)
return resp.SetStatus(basic.CodeServiceErr, fmt.Sprintf("算法请求--LOGO信息--错误:%+v", err))
}
// 返回成功的响应和上传URL

View File

@ -1,6 +1,7 @@
package logic
import (
"fmt"
"fusenapi/service/repositories"
"fusenapi/utils/auth"
"fusenapi/utils/basic"
@ -48,7 +49,7 @@ func (l *LogoRemovebgLogic) LogoRemovebg(req *types.LogoRemovebgReq, userinfo *a
})
if err != nil {
return resp.SetStatus(basic.CodeServiceErr)
return resp.SetStatus(basic.CodeServiceErr, fmt.Sprintf("算法请求--LOGO信息--错误:%+v", err))
}
// 返回成功的响应和上传URL

View File

@ -1,6 +1,7 @@
package logic
import (
"fmt"
"fusenapi/model/gmodel"
"fusenapi/service/repositories"
"fusenapi/utils/auth"
@ -135,7 +136,7 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us
})
if err != nil {
logx.Error(err)
return resp.SetStatus(basic.CodeServiceErr)
return resp.SetStatus(basic.CodeServiceErr, fmt.Sprintf("算法请求--LOGO信息--错误:%+v", err))
}
logoUrl = resLogoStandard.ResourceUrl
} else {
@ -178,7 +179,7 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us
if err != nil {
logx.Error(err)
return resp.SetStatus(basic.CodeServiceErr)
return resp.SetStatus(basic.CodeServiceErr, fmt.Sprintf("算法请求--LOGO信息--错误:%+v", err))
}
resultStr = resLogoStandard.Res