oss文件存储服务-租户存储空间信息同步接口优化

This commit is contained in:
2025-12-31 09:53:21 +08:00
parent 17e7ae0437
commit 827f5bf09c
3 changed files with 4 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ func (f *file) UploadFile(ctx context.Context, req *dto.UploadFileReq) (res *dto
if tenantOssTotal.Id.IsZero() {
tenantOssTotalEntity.TenantId = user.TenantId
tenantOssTotalEntity.UsedOssSize = 0
tenantOssTotalEntity.TotalOssSize = g.Cfg().MustGet(ctx, "oss.capacitySize").Int() * 1024 * 1024 * 1024
tenantOssTotalEntity.TotalOssSize = g.Cfg().MustGet(ctx, "oss.capacitySize").Int() * 1024 * 1024
} else {
tenantOssTotalEntity = tenantOssTotal.TenantOssTotal
}
@@ -107,8 +107,7 @@ func (f *file) UploadFile(ctx context.Context, req *dto.UploadFileReq) (res *dto
FileURL: fileURL,
FileSize: fileSize,
}
err = dao.File.Insert(ctx, ossEntity)
if err != nil {
if err = dao.File.Insert(ctx, ossEntity); err != nil {
return nil, err
}
// 返回图片url