feat: add superadmin assets and notifications
This commit is contained in:
119
backend/app/http/super/v1/dto/super_asset.go
Normal file
119
backend/app/http/super/v1/dto/super_asset.go
Normal file
@@ -0,0 +1,119 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"quyun/v2/app/requests"
|
||||
"quyun/v2/pkg/consts"
|
||||
)
|
||||
|
||||
// SuperAssetListFilter 超管资产列表查询条件。
|
||||
type SuperAssetListFilter struct {
|
||||
requests.Pagination
|
||||
// ID 资产ID,精确匹配。
|
||||
ID *int64 `query:"id"`
|
||||
// TenantID 租户ID,精确匹配。
|
||||
TenantID *int64 `query:"tenant_id"`
|
||||
// TenantCode 租户编码,模糊匹配。
|
||||
TenantCode *string `query:"tenant_code"`
|
||||
// TenantName 租户名称,模糊匹配。
|
||||
TenantName *string `query:"tenant_name"`
|
||||
// UserID 上传用户ID,精确匹配。
|
||||
UserID *int64 `query:"user_id"`
|
||||
// Username 上传用户名/昵称,模糊匹配。
|
||||
Username *string `query:"username"`
|
||||
// Type 媒体类型过滤。
|
||||
Type *consts.MediaAssetType `query:"type"`
|
||||
// Status 处理状态过滤。
|
||||
Status *consts.MediaAssetStatus `query:"status"`
|
||||
// Provider 存储提供方过滤。
|
||||
Provider *string `query:"provider"`
|
||||
// ObjectKey 对象Key关键字,模糊匹配。
|
||||
ObjectKey *string `query:"object_key"`
|
||||
// CreatedAtFrom 上传时间起始(RFC3339)。
|
||||
CreatedAtFrom *string `query:"created_at_from"`
|
||||
// CreatedAtTo 上传时间结束(RFC3339)。
|
||||
CreatedAtTo *string `query:"created_at_to"`
|
||||
// SizeMin 文件大小下限(字节)。
|
||||
SizeMin *int64 `query:"size_min"`
|
||||
// SizeMax 文件大小上限(字节)。
|
||||
SizeMax *int64 `query:"size_max"`
|
||||
// Asc 升序字段(id/created_at)。
|
||||
Asc *string `query:"asc"`
|
||||
// Desc 降序字段(id/created_at)。
|
||||
Desc *string `query:"desc"`
|
||||
}
|
||||
|
||||
// SuperAssetUsageFilter 超管资产用量统计查询条件。
|
||||
type SuperAssetUsageFilter struct {
|
||||
// TenantID 租户ID(不传代表全平台)。
|
||||
TenantID *int64 `query:"tenant_id"`
|
||||
}
|
||||
|
||||
// SuperAssetDeleteQuery 超管资产删除参数。
|
||||
type SuperAssetDeleteQuery struct {
|
||||
// Force 是否强制删除(忽略被内容引用的限制)。
|
||||
Force *bool `query:"force"`
|
||||
}
|
||||
|
||||
// SuperAssetItem 超管资产条目。
|
||||
type SuperAssetItem struct {
|
||||
// ID 资产ID。
|
||||
ID int64 `json:"id"`
|
||||
// TenantID 租户ID。
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
// TenantCode 租户编码。
|
||||
TenantCode string `json:"tenant_code"`
|
||||
// TenantName 租户名称。
|
||||
TenantName string `json:"tenant_name"`
|
||||
// UserID 上传用户ID。
|
||||
UserID int64 `json:"user_id"`
|
||||
// Username 上传用户名/昵称。
|
||||
Username string `json:"username"`
|
||||
// Type 媒体类型。
|
||||
Type consts.MediaAssetType `json:"type"`
|
||||
// Status 处理状态。
|
||||
Status consts.MediaAssetStatus `json:"status"`
|
||||
// Provider 存储提供方。
|
||||
Provider string `json:"provider"`
|
||||
// Bucket 存储桶名称。
|
||||
Bucket string `json:"bucket"`
|
||||
// ObjectKey 对象Key。
|
||||
ObjectKey string `json:"object_key"`
|
||||
// URL 访问URL(若可用)。
|
||||
URL string `json:"url"`
|
||||
// Filename 原始文件名。
|
||||
Filename string `json:"filename"`
|
||||
// Size 文件大小(字节)。
|
||||
Size int64 `json:"size"`
|
||||
// Hash 文件哈希(MD5)。
|
||||
Hash string `json:"hash"`
|
||||
// Variant 媒体变体(main/preview/cover 等)。
|
||||
Variant consts.MediaAssetVariant `json:"variant"`
|
||||
// SourceAssetID 源资产ID(用于变体关联)。
|
||||
SourceAssetID int64 `json:"source_asset_id"`
|
||||
// UsedCount 被内容引用次数。
|
||||
UsedCount int64 `json:"used_count"`
|
||||
// CreatedAt 创建时间(RFC3339)。
|
||||
CreatedAt string `json:"created_at"`
|
||||
// UpdatedAt 更新时间(RFC3339)。
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
// SuperAssetUsageResponse 超管资产用量统计响应。
|
||||
type SuperAssetUsageResponse struct {
|
||||
// TotalCount 资产总量。
|
||||
TotalCount int64 `json:"total_count"`
|
||||
// TotalSize 资产总大小(字节)。
|
||||
TotalSize int64 `json:"total_size"`
|
||||
// ByType 按媒体类型汇总的用量统计。
|
||||
ByType []SuperAssetUsageItem `json:"by_type"`
|
||||
}
|
||||
|
||||
// SuperAssetUsageItem 资产类型用量统计条目。
|
||||
type SuperAssetUsageItem struct {
|
||||
// Type 媒体类型。
|
||||
Type consts.MediaAssetType `json:"type"`
|
||||
// Count 该类型资产数量。
|
||||
Count int64 `json:"count"`
|
||||
// TotalSize 该类型资产大小总和(字节)。
|
||||
TotalSize int64 `json:"total_size"`
|
||||
}
|
||||
Reference in New Issue
Block a user