Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
f8792a9c2b
|
@ -16,5 +16,5 @@ AWS:
|
|||
Token:
|
||||
BLMService:
|
||||
LogoCombine:
|
||||
#Url: "http://192.168.1.7:45678/LogoCombine"
|
||||
#Url: "http://192.168.1.7:8999/LogoCombine"
|
||||
Url: "http://18.119.109.254:8999/LogoCombine"
|
|
@ -2,14 +2,16 @@ package logic
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fusenapi/model/gmodel"
|
||||
"fusenapi/utils/auth"
|
||||
"fusenapi/utils/basic"
|
||||
"fusenapi/utils/curl"
|
||||
"fusenapi/utils/file"
|
||||
"fusenapi/utils/hash"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"context"
|
||||
|
||||
|
@ -17,6 +19,7 @@ import (
|
|||
"fusenapi/server/resource/internal/types"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type LogoCombineLogic struct {
|
||||
|
@ -75,8 +78,10 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
|
|||
})
|
||||
} else {
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatus(basic.CodeDbSqlErr, "LogoCombine error")
|
||||
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
logx.Error(err)
|
||||
return resp.SetStatus(basic.CodeDbSqlErr, "LogoCombine error")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,7 +128,11 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
|
|||
postMap["param_data"] = combineParam
|
||||
postMapB, _ := json.Marshal(postMap)
|
||||
|
||||
result, err := http.Post(l.svcCtx.Config.BLMService.LogoCombine.Url, "application/json", strings.NewReader(string(postMapB)))
|
||||
//result, err := http.Post(l.svcCtx.Config.BLMService.LogoCombine.Url, "application/json", strings.NewReader(string(postMapB)))
|
||||
var headerData = make(map[string]string, 1)
|
||||
headerData["Content-Type"] = "application/json"
|
||||
result, err := curl.ApiCall(l.svcCtx.Config.BLMService.LogoCombine.Url, "POST", headerData, strings.NewReader(string(postMapB)), time.Second*20)
|
||||
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatus(basic.CodeFileLogoCombineErr, "service post fail")
|
||||
|
@ -134,8 +143,9 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
|
|||
logx.Error(err)
|
||||
return resp.SetStatus(basic.CodeFileLogoCombineErr, "service read fail")
|
||||
}
|
||||
ress := string(b)
|
||||
|
||||
if string(b) == "Internal Server Error" {
|
||||
if ress == "Internal Server Error" {
|
||||
return resp.SetStatus(basic.CodeFileLogoCombineErr, "service read fail")
|
||||
}
|
||||
|
||||
|
|
|
@ -168,5 +168,12 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us
|
|||
return resp.SetStatus(basic.CodeFileUploadLogoErr, "service fail")
|
||||
}
|
||||
|
||||
return resp.SetStatus(basic.CodeOK)
|
||||
// 返回成功的响应和上传URL
|
||||
return resp.SetStatus(basic.CodeOK, map[string]interface{}{
|
||||
"upload_data": UploadUrl{
|
||||
Status: 1,
|
||||
ResourceId: uploadRes.ResourceId,
|
||||
ResourceUrl: uploadRes.ResourceUrl,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user