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