From cb3e8d4db682a38f673d11855aade6634afcc0e8 Mon Sep 17 00:00:00 2001 From: Hiven Date: Wed, 16 Aug 2023 17:33:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=87=8D=E6=9E=84=E5=90=88=E5=9B=BE?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/gmodel/fs_resource_gen.go | 1 + model/gmodel/fs_tags_gen.go | 4 ++-- server/resource/internal/logic/logocombinelogic.go | 3 ++- service/repositories/image_handle.go | 1 + utils/file/upload.go | 3 +++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/model/gmodel/fs_resource_gen.go b/model/gmodel/fs_resource_gen.go index 400dd9e4..0f308faf 100644 --- a/model/gmodel/fs_resource_gen.go +++ b/model/gmodel/fs_resource_gen.go @@ -18,6 +18,7 @@ type FsResource struct { MetaKey1 *string `gorm:"index;default:'';" json:"meta_key1"` // 需要关键信息查询的自定义属性1,可以动态增加 ApiType *int64 `gorm:"default:1;" json:"api_type"` // 调用类型:1=对外,2=对内 BucketName *string `gorm:"default:'';" json:"bucket_name"` // 存储桶名: 1=持久 2=缓存 + Source *string `gorm:"default:'';" json:"source"` // 来源 } type FsResourceModel struct { db *gorm.DB diff --git a/model/gmodel/fs_tags_gen.go b/model/gmodel/fs_tags_gen.go index 5f27544b..1a7d89c9 100644 --- a/model/gmodel/fs_tags_gen.go +++ b/model/gmodel/fs_tags_gen.go @@ -16,8 +16,8 @@ type FsTags struct { Icon *string `gorm:"default:'';" json:"icon"` // 标签图标 Status *int64 `gorm:"default:1;" json:"status"` // 状态 1:可用 Description *string `gorm:"default:'';" json:"description"` // 介绍 Seo - RecommendProduct *string `gorm:"default:'';" json:"recommend_product"` // - RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` // + RecommendProduct *string `gorm:"default:'';" json:"recommend_product"` // 推荐产品id例如: 1,3,4,5 + RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` // 推荐排序例如:1324 Category *int64 `gorm:"default:1;" json:"category"` // 分类:1前台用的 2后台用的 } type FsTagsModel struct { diff --git a/server/resource/internal/logic/logocombinelogic.go b/server/resource/internal/logic/logocombinelogic.go index 661228e3..53b02768 100644 --- a/server/resource/internal/logic/logocombinelogic.go +++ b/server/resource/internal/logic/logocombinelogic.go @@ -65,7 +65,8 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth Slogan: req.Slogan, Phone: req.Phone, Address: req.Address, - Qrcode: req.Qrcode, + + Qrcode: req.Qrcode, }) if err != nil { diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index d9bdc43e..8db2eecc 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -214,6 +214,7 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq AwsSession: l.AwsSession, } uploadRes, err := upload.UploadFileByBase64(&file.UploadBaseReq{ + Source: "combine-image", FileHash: resourceId, FileData: fileBase.(string), UploadBucket: 1, diff --git a/utils/file/upload.go b/utils/file/upload.go index d19752e7..d561ae28 100644 --- a/utils/file/upload.go +++ b/utils/file/upload.go @@ -22,6 +22,7 @@ type Upload struct { } type UploadBaseReq struct { + Source string FileHash string FileData string Metadata string @@ -119,6 +120,7 @@ func (upload *Upload) UploadFileByBase64(req *UploadBaseReq) (*UploadBaseRes, er Metadata: &req.Metadata, ApiType: &apiType, BucketName: bucketName, + Source: &req.Source, }).Error if err != nil { logx.Errorf("err:%+v,desc:%+v", err, "fail.upload.resourceInfoAdd.mysql") @@ -212,6 +214,7 @@ func (upload *Upload) UploadFileByByte(req *UploadBaseReq) (*UploadBaseRes, erro Metadata: &req.Metadata, ApiType: &apiType, BucketName: bucketName, + Source: &req.Source, }).Error if err != nil { logx.Errorf("err:%+v,desc:%+v", err, "fail.upload.resourceInfoAdd.mysql")