fix:上传模块调整
This commit is contained in:
parent
a80a71255a
commit
c3cd57b7e5
|
@ -83,8 +83,10 @@ func (l *UploadCallbackLogic) UploadCallback(req *types.UploadCallbackReq, useri
|
||||||
fsResource.ResourceUrl = &req.ResourceUrl
|
fsResource.ResourceUrl = &req.ResourceUrl
|
||||||
fsResource.Metadata = &req.Metadata
|
fsResource.Metadata = &req.Metadata
|
||||||
fsResource.ApiType = &req.ApiType
|
fsResource.ApiType = &req.ApiType
|
||||||
|
fsResource.Source = &req.Source
|
||||||
fsResource.BucketName = bucketName
|
fsResource.BucketName = bucketName
|
||||||
fsResource.Version = &version
|
fsResource.Version = &version
|
||||||
|
|
||||||
if resourceInfo.ResourceId == "" {
|
if resourceInfo.ResourceId == "" {
|
||||||
_, err = resourceModelTS.BuilderCreate(ctx, transBuilder, fsResource)
|
_, err = resourceModelTS.BuilderCreate(ctx, transBuilder, fsResource)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -90,6 +90,7 @@ func (l *UploadFileBackendLogic) UploadFileBackend(req *types.UploadFileBackendR
|
||||||
ApiType: req.ApiType,
|
ApiType: req.ApiType,
|
||||||
UserId: userId,
|
UserId: userId,
|
||||||
GuestId: guestId,
|
GuestId: guestId,
|
||||||
|
Source: req.Source,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -77,6 +77,7 @@ func (l *UploadFileBaseLogic) UploadFileBase(req *types.UploadFileBaseReq, useri
|
||||||
ApiType: req.ApiType,
|
ApiType: req.ApiType,
|
||||||
UserId: userId,
|
UserId: userId,
|
||||||
GuestId: guestId,
|
GuestId: guestId,
|
||||||
|
Source: req.Source,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -123,6 +123,7 @@ func (l *UploadFilesBackendLogic) UploadFilesBackend(req *types.UploadFilesReq,
|
||||||
ApiType: req.ApiType,
|
ApiType: req.ApiType,
|
||||||
Bucket: bucketName,
|
Bucket: bucketName,
|
||||||
HashKey: hashKey,
|
HashKey: hashKey,
|
||||||
|
Source: req.Source,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, func(item interface{}, writer mr.Writer[interface{}], cancel func(error)) {
|
}, func(item interface{}, writer mr.Writer[interface{}], cancel func(error)) {
|
||||||
|
@ -148,6 +149,7 @@ func (l *UploadFilesBackendLogic) UploadFilesBackend(req *types.UploadFilesReq,
|
||||||
ApiType: req.ApiType,
|
ApiType: req.ApiType,
|
||||||
UserId: userId,
|
UserId: userId,
|
||||||
GuestId: guestId,
|
GuestId: guestId,
|
||||||
|
Source: uploadDataInfo.Source,
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
uploadUrl.Status = 1
|
uploadUrl.Status = 1
|
||||||
|
@ -201,6 +203,7 @@ type UploadData struct {
|
||||||
Bucket *string `json:"bucket"`
|
Bucket *string `json:"bucket"`
|
||||||
HashKey string `json:"hash_key"`
|
HashKey string `json:"hash_key"`
|
||||||
FileData []byte `fsfile:"data"`
|
FileData []byte `fsfile:"data"`
|
||||||
|
Source string `json:"source"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UploadUrl struct {
|
type UploadUrl struct {
|
||||||
|
|
|
@ -115,6 +115,7 @@ func (l *UploadLogoLogic) UploadLogo(req *types.UploadLogoReq, userinfo *auth.Us
|
||||||
ApiType: 2,
|
ApiType: 2,
|
||||||
UserId: userId,
|
UserId: userId,
|
||||||
GuestId: guestId,
|
GuestId: guestId,
|
||||||
|
Source: "upload-logo",
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -13,6 +13,7 @@ type UploadFileBaseReq struct {
|
||||||
UserId int64 `form:"user_id,optional"` // 上传文件额外信息
|
UserId int64 `form:"user_id,optional"` // 上传文件额外信息
|
||||||
GuestId int64 `form:"guest_id,optional"` // 上传文件额外信息
|
GuestId int64 `form:"guest_id,optional"` // 上传文件额外信息
|
||||||
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
||||||
|
Source string `form:"source"` // 上传来源
|
||||||
}
|
}
|
||||||
|
|
||||||
type UploadLogoReq struct {
|
type UploadLogoReq struct {
|
||||||
|
@ -28,12 +29,14 @@ type UploadFileBackendReq struct {
|
||||||
FileKey string `form:"file_key"` // 上传唯一标识信息
|
FileKey string `form:"file_key"` // 上传唯一标识信息
|
||||||
FileSize int64 `form:"file_size,optional"` // 上传唯一标识信息
|
FileSize int64 `form:"file_size,optional"` // 上传唯一标识信息
|
||||||
Metadata string `form:"meta_data,optional"` // 上传文件额外信息
|
Metadata string `form:"meta_data,optional"` // 上传文件额外信息
|
||||||
|
Source string `form:"source"` // 上传来源
|
||||||
}
|
}
|
||||||
|
|
||||||
type UploadFilesReq struct {
|
type UploadFilesReq struct {
|
||||||
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
||||||
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
||||||
UploadInfo string `form:"upload_info"` // 上传信息 json
|
UploadInfo string `form:"upload_info"` // 上传信息 json
|
||||||
|
Source string `form:"source"` // 上传来源
|
||||||
}
|
}
|
||||||
|
|
||||||
type UploadCallbackReq struct {
|
type UploadCallbackReq struct {
|
||||||
|
@ -43,6 +46,7 @@ type UploadCallbackReq struct {
|
||||||
ResourceUrl string `form:"resource_url"` // 资源URL
|
ResourceUrl string `form:"resource_url"` // 资源URL
|
||||||
Metadata string `form:"metadata,optional"` // 元数据,json格式,存储图像分率
|
Metadata string `form:"metadata,optional"` // 元数据,json格式,存储图像分率
|
||||||
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
||||||
|
Source string `form:"source"` // 上传来源
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestUpFile struct {
|
type RequestUpFile struct {
|
||||||
|
|
|
@ -53,6 +53,7 @@ type (
|
||||||
UserId int64 `form:"user_id,optional"` // 上传文件额外信息
|
UserId int64 `form:"user_id,optional"` // 上传文件额外信息
|
||||||
GuestId int64 `form:"guest_id,optional"` // 上传文件额外信息
|
GuestId int64 `form:"guest_id,optional"` // 上传文件额外信息
|
||||||
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
||||||
|
Source string `form:"source"` // 上传来源
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -72,12 +73,14 @@ type (
|
||||||
FileKey string `form:"file_key"` // 上传唯一标识信息
|
FileKey string `form:"file_key"` // 上传唯一标识信息
|
||||||
FileSize int64 `form:"file_size,optional"` // 上传唯一标识信息
|
FileSize int64 `form:"file_size,optional"` // 上传唯一标识信息
|
||||||
Metadata string `form:"meta_data,optional"` // 上传文件额外信息
|
Metadata string `form:"meta_data,optional"` // 上传文件额外信息
|
||||||
|
Source string `form:"source"` // 上传来源
|
||||||
}
|
}
|
||||||
|
|
||||||
UploadFilesReq {
|
UploadFilesReq {
|
||||||
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
||||||
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
||||||
UploadInfo string `form:"upload_info"` // 上传信息 json
|
UploadInfo string `form:"upload_info"` // 上传信息 json
|
||||||
|
Source string `form:"source"` // 上传来源
|
||||||
}
|
}
|
||||||
UploadCallbackReq {
|
UploadCallbackReq {
|
||||||
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
UploadBucket int64 `form:"upload_bucket,options=[1,2],default=1"` // 上传桶名:1=缓存,2=持久
|
||||||
|
@ -86,6 +89,7 @@ type (
|
||||||
ResourceUrl string `form:"resource_url"` // 资源URL
|
ResourceUrl string `form:"resource_url"` // 资源URL
|
||||||
Metadata string `form:"metadata,optional"` // 元数据,json格式,存储图像分率
|
Metadata string `form:"metadata,optional"` // 元数据,json格式,存储图像分率
|
||||||
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
ApiType int64 `form:"api_type,options=[1,2],default=1"` // 调用类型:1=对外,2=对内
|
||||||
|
Source string `form:"source"` // 上传来源
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user