Merge branch 'feature/mhw-v1.01' of gitee.com:fusenpack/fusenapi into feature/mhw-v1.01

This commit is contained in:
momo 2023-09-21 12:11:21 +08:00
commit e01884cce6
3 changed files with 12 additions and 10 deletions

View File

@ -26,8 +26,8 @@ run_server() {
cd - > /dev/null
}
find /tmp/go-build* -mmin +5 -exec rm -rf {} +
find /tmp/go-link* -mmin +5 -exec rm -rf {} +
find /tmp/go-build* -mmin +5 -exec rm -rf {} +
find /tmp/go-link* -mmin +5 -exec rm -rf {} +
# 列出所有服务器目录
server_dirs=() # 初始化一个空数组

View File

@ -133,7 +133,7 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r
for _, mquery := range mquerys {
sqlstr := fmt.Sprintf("select id, module, %s as querydata from %s where %s order by ctime asc limit 1", mquery.EncodeQuery("metadata"), mquery.TableName, mquery.Cond)
sqlstr := fmt.Sprintf("select id, module, %s as querydata from %s where %s order by ctime dec limit 1", mquery.EncodeQuery("metadata"), mquery.TableName, mquery.Cond)
raw := l.svcCtx.MysqlConn.Raw(sqlstr)

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)