Generating commit message...
This commit is contained in:
@@ -13,7 +13,7 @@ database:
|
||||
host: "116.204.74.41"
|
||||
port: "15432"
|
||||
user: "postgres"
|
||||
pass: "123456"
|
||||
pass: "Bjang09@686^*^"
|
||||
name: "oss"
|
||||
role: "master"
|
||||
maxIdle: "5"
|
||||
@@ -30,7 +30,7 @@ database:
|
||||
host: "116.204.74.41"
|
||||
port: "15432"
|
||||
user: "postgres"
|
||||
pass: "123456"
|
||||
pass: "Bjang09@686^*^"
|
||||
name: "oss"
|
||||
role: "slave"
|
||||
maxIdle: "5"
|
||||
@@ -71,7 +71,7 @@ minio:
|
||||
region: "us-east-1" # 与 MinIO 服务端 REGION 一致(默认 us-east-1)
|
||||
|
||||
# 文件上传服务地址,与oss模块minio中的endpoint一致
|
||||
filePrefix: "116.204.74.41:9000"
|
||||
filePrefix: "http://116.204.74.41:9000"
|
||||
|
||||
# 文件存储初始化容量大小配置
|
||||
oss:
|
||||
|
||||
@@ -8,21 +8,18 @@ import (
|
||||
type File struct {
|
||||
beans.SQLBaseDO `orm:",inherit"` // 嵌入基础字段:Id, Bid, Creator, CreatedAt, Updater, UpdatedAt, Deleter, DeletedAt, IsDeleted
|
||||
// 业务字段
|
||||
TenantId uint64 `orm:"tenant_id" json:"tenantId"` // 租户ID
|
||||
FileURL string `orm:"file_url" json:"fileURL"` // 文件URL
|
||||
FileSize int `orm:"file_size" json:"fileSize"`
|
||||
}
|
||||
|
||||
type fileCol struct {
|
||||
beans.SQLBaseCol
|
||||
TenantId string
|
||||
FileURL string
|
||||
FileSize string
|
||||
}
|
||||
|
||||
var FileCol = fileCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
TenantId: "tenant_id",
|
||||
FileURL: "file_url",
|
||||
FileSize: "file_size",
|
||||
}
|
||||
|
||||
@@ -8,21 +8,18 @@ import (
|
||||
type TenantOssTotal struct {
|
||||
beans.SQLBaseDO `orm:",inherit"` // 嵌入基础字段:Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
|
||||
// 基础信息
|
||||
TenantId uint64 `orm:"tenant_id" json:"tenantId"` // 租户ID
|
||||
UsedOssSize int `orm:"used_oss_size" json:"usedOssSize"`
|
||||
TotalOssSize int `orm:"total_oss_size" json:"totalOssSize"`
|
||||
}
|
||||
|
||||
type tenantOssCol struct {
|
||||
beans.SQLBaseCol
|
||||
TenantId string
|
||||
UsedOssSize string
|
||||
TotalOssSize string
|
||||
}
|
||||
|
||||
var TenantOssCol = tenantOssCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
TenantId: "tenant_id",
|
||||
UsedOssSize: "used_oss_size",
|
||||
TotalOssSize: "total_oss_size",
|
||||
}
|
||||
|
||||
@@ -115,8 +115,13 @@ func (f *file) UploadFile(ctx context.Context, req *dto.UploadFileReq) (res *dto
|
||||
return nil, err
|
||||
}
|
||||
// 返回图片url
|
||||
return &dto.UploadFileRes{
|
||||
res = &dto.UploadFileRes{
|
||||
FileURL: fileURL,
|
||||
FileAddressPrefix: minio.GetFileAddressPrefix(ctx),
|
||||
}, err
|
||||
}
|
||||
url, err := utils.GetFileAddressPrefix(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res.FileAddressPrefix = url
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user