文件存储-增加文件上传记录接口,增加定时同步租户文件存储容量信息接口
This commit is contained in:
18
model/dto/file_dto.go
Normal file
18
model/dto/file_dto.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
)
|
||||
|
||||
// UploadFileReq 上传文件请求
|
||||
type UploadFileReq struct {
|
||||
g.Meta `path:"/uploadFile" method:"post" tags:"存储管理" summary:"上传文件" dc:"上传文件"`
|
||||
File *ghttp.UploadFile `json:"file" type:"file"` // 文件URL
|
||||
}
|
||||
|
||||
// UploadFileRes 上传文件响应
|
||||
type UploadFileRes struct {
|
||||
FileURL string `json:"fileURL" dc:"上传地址"`
|
||||
FileAddressPrefix string `json:"fileAddressPrefix"`
|
||||
}
|
||||
17
model/dto/tenant_oss_total.go
Normal file
17
model/dto/tenant_oss_total.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"oss/model/entity"
|
||||
)
|
||||
|
||||
// GetByTenantIdReq 根据租户id获取存储总量请求
|
||||
type GetByTenantIdReq struct {
|
||||
g.Meta `path:"/GetOneByTenantId" method:"get" tags:"租户存储总量管理" summary:"获取存储总量" dc:"获取存储总量"`
|
||||
TenantId string `json:"tenantId" v:"required#租户id不能为空"`
|
||||
}
|
||||
|
||||
// GetByTenantIdRes 根据租户id获取存储总量响应
|
||||
type GetByTenantIdRes struct {
|
||||
*entity.TenantOssTotal
|
||||
}
|
||||
19
model/entity/file.go
Normal file
19
model/entity/file.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
"oss/consts"
|
||||
)
|
||||
|
||||
// File 存储文件实体
|
||||
type File struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
// 基础信息
|
||||
FileURL string `bson:"fileURL" json:"fileURL"` // 图URL
|
||||
FileSize int64 `bson:"fileSize" json:"fileSize"`
|
||||
}
|
||||
|
||||
// CollectionName 存储集合名称
|
||||
func (File) CollectionName() string {
|
||||
return consts.FileCollection
|
||||
}
|
||||
19
model/entity/tenant_oss_total.go
Normal file
19
model/entity/tenant_oss_total.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitee.com/red-future---jilin-g/common/do"
|
||||
"oss/consts"
|
||||
)
|
||||
|
||||
// TenantOssTotal 租户储存服务总计实体
|
||||
type TenantOssTotal struct {
|
||||
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
// 基础信息
|
||||
UsedOssSize int64 `bson:"usedOssSize" json:"usedOssSize"`
|
||||
TotalOssSize int64 `bson:"totalOssSize" json:"totalOssSize"`
|
||||
}
|
||||
|
||||
// CollectionName 租户储存服务总计集合名称
|
||||
func (TenantOssTotal) CollectionName() string {
|
||||
return consts.TenantOssTotalCollection
|
||||
}
|
||||
Reference in New Issue
Block a user