This commit is contained in:
laodaming 2023-09-21 11:35:00 +08:00
parent 37fc648025
commit 5198ee0cda

View File

@ -9,6 +9,7 @@ import (
"fusenapi/utils/curl"
"fusenapi/utils/file"
"fusenapi/utils/hash"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws/session"
@ -222,21 +223,22 @@ type TemplateTagColor struct {
}
func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq) (*LogoCombineRes, error) {
// 查询logo最新基础信息
resLogoInfo, err := l.LogoInfo(ctx, &LogoInfoReq{
UserId: in.UserId,
GuestId: in.GuestId,
})
s := strings.Split(in.LogoUrl, "/")
if len(s) <= 1 {
return nil, errors.New("无效的logo")
}
logoResourceId := s[len(s)-1]
userMaterialModel := gmodel.NewFsUserMaterialModel(l.MysqlConn)
resLogoInfo, err := userMaterialModel.FindOneByLogoResourceId(ctx, logoResourceId)
if err != nil {
logx.Error(err)
return nil, err
}
// 根据hash 查询数据资源
var hashKeyData = *in
hashKeyData.GuestId = 0
hashKeyData.UserId = 0
hashKeyData.LogoUrl = *resLogoInfo.LogoUrl
hashKeyData.LogoUrl = in.LogoUrl
var hashKeyDataMap map[string]interface{}
hashKeyDataB, _ := json.Marshal(hashKeyData)
json.Unmarshal(hashKeyDataB, &hashKeyDataMap)