fix:重构合图模块

This commit is contained in:
Hiven 2023-08-16 17:33:34 +08:00
parent 9bcb95e540
commit cb3e8d4db6
5 changed files with 9 additions and 3 deletions

View File

@ -18,6 +18,7 @@ type FsResource struct {
MetaKey1 *string `gorm:"index;default:'';" json:"meta_key1"` // 需要关键信息查询的自定义属性1,可以动态增加 MetaKey1 *string `gorm:"index;default:'';" json:"meta_key1"` // 需要关键信息查询的自定义属性1,可以动态增加
ApiType *int64 `gorm:"default:1;" json:"api_type"` // 调用类型1=对外2=对内 ApiType *int64 `gorm:"default:1;" json:"api_type"` // 调用类型1=对外2=对内
BucketName *string `gorm:"default:'';" json:"bucket_name"` // 存储桶名: 1=持久 2=缓存 BucketName *string `gorm:"default:'';" json:"bucket_name"` // 存储桶名: 1=持久 2=缓存
Source *string `gorm:"default:'';" json:"source"` // 来源
} }
type FsResourceModel struct { type FsResourceModel struct {
db *gorm.DB db *gorm.DB

View File

@ -16,8 +16,8 @@ type FsTags struct {
Icon *string `gorm:"default:'';" json:"icon"` // 标签图标 Icon *string `gorm:"default:'';" json:"icon"` // 标签图标
Status *int64 `gorm:"default:1;" json:"status"` // 状态 1可用 Status *int64 `gorm:"default:1;" json:"status"` // 状态 1可用
Description *string `gorm:"default:'';" json:"description"` // 介绍 Seo Description *string `gorm:"default:'';" json:"description"` // 介绍 Seo
RecommendProduct *string `gorm:"default:'';" json:"recommend_product"` // RecommendProduct *string `gorm:"default:'';" json:"recommend_product"` // 推荐产品id例如: 1,3,4,5
RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` // RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` // 推荐排序例如:1324
Category *int64 `gorm:"default:1;" json:"category"` // 分类1前台用的 2后台用的 Category *int64 `gorm:"default:1;" json:"category"` // 分类1前台用的 2后台用的
} }
type FsTagsModel struct { type FsTagsModel struct {

View File

@ -65,7 +65,8 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
Slogan: req.Slogan, Slogan: req.Slogan,
Phone: req.Phone, Phone: req.Phone,
Address: req.Address, Address: req.Address,
Qrcode: req.Qrcode,
Qrcode: req.Qrcode,
}) })
if err != nil { if err != nil {

View File

@ -214,6 +214,7 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
AwsSession: l.AwsSession, AwsSession: l.AwsSession,
} }
uploadRes, err := upload.UploadFileByBase64(&file.UploadBaseReq{ uploadRes, err := upload.UploadFileByBase64(&file.UploadBaseReq{
Source: "combine-image",
FileHash: resourceId, FileHash: resourceId,
FileData: fileBase.(string), FileData: fileBase.(string),
UploadBucket: 1, UploadBucket: 1,

View File

@ -22,6 +22,7 @@ type Upload struct {
} }
type UploadBaseReq struct { type UploadBaseReq struct {
Source string
FileHash string FileHash string
FileData string FileData string
Metadata string Metadata string
@ -119,6 +120,7 @@ func (upload *Upload) UploadFileByBase64(req *UploadBaseReq) (*UploadBaseRes, er
Metadata: &req.Metadata, Metadata: &req.Metadata,
ApiType: &apiType, ApiType: &apiType,
BucketName: bucketName, BucketName: bucketName,
Source: &req.Source,
}).Error }).Error
if err != nil { if err != nil {
logx.Errorf("err:%+vdesc:%+v", err, "fail.upload.resourceInfoAdd.mysql") logx.Errorf("err:%+vdesc:%+v", err, "fail.upload.resourceInfoAdd.mysql")
@ -212,6 +214,7 @@ func (upload *Upload) UploadFileByByte(req *UploadBaseReq) (*UploadBaseRes, erro
Metadata: &req.Metadata, Metadata: &req.Metadata,
ApiType: &apiType, ApiType: &apiType,
BucketName: bucketName, BucketName: bucketName,
Source: &req.Source,
}).Error }).Error
if err != nil { if err != nil {
logx.Errorf("err:%+vdesc:%+v", err, "fail.upload.resourceInfoAdd.mysql") logx.Errorf("err:%+vdesc:%+v", err, "fail.upload.resourceInfoAdd.mysql")