feat: add superadmin assets and notifications

This commit is contained in:
2026-01-15 15:28:41 +08:00
parent c683fa5cf3
commit b896d0fa00
22 changed files with 4852 additions and 260 deletions

View File

@@ -0,0 +1,140 @@
package dto
import (
"quyun/v2/app/requests"
"quyun/v2/pkg/consts"
)
// SuperNotificationListFilter 超管通知列表查询条件。
type SuperNotificationListFilter 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.NotificationType `query:"type"`
// IsRead 是否已读过滤。
IsRead *bool `query:"is_read"`
// Keyword 标题或内容关键词,模糊匹配。
Keyword *string `query:"keyword"`
// CreatedAtFrom 创建时间起始RFC3339
CreatedAtFrom *string `query:"created_at_from"`
// CreatedAtTo 创建时间结束RFC3339
CreatedAtTo *string `query:"created_at_to"`
// Asc 升序字段id/created_at
Asc *string `query:"asc"`
// Desc 降序字段id/created_at
Desc *string `query:"desc"`
}
// SuperNotificationBroadcastForm 超管通知群发参数。
type SuperNotificationBroadcastForm struct {
// TenantID 租户ID选填用于指定租户成员
TenantID *int64 `json:"tenant_id"`
// UserIDs 指定接收用户ID列表优先级高于 TenantID
UserIDs []int64 `json:"user_ids"`
// Type 通知类型system/order/audit/interaction
Type consts.NotificationType `json:"type"`
// Title 通知标题。
Title string `json:"title"`
// Content 通知内容。
Content string `json:"content"`
}
// SuperNotificationItem 超管通知条目。
type SuperNotificationItem 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.NotificationType `json:"type"`
// Title 通知标题。
Title string `json:"title"`
// Content 通知内容。
Content string `json:"content"`
// IsRead 是否已读。
IsRead bool `json:"is_read"`
// CreatedAt 创建时间RFC3339
CreatedAt string `json:"created_at"`
}
// SuperNotificationTemplateListFilter 超管通知模板列表查询条件。
type SuperNotificationTemplateListFilter struct {
requests.Pagination
// TenantID 租户ID不传代表全平台模板
TenantID *int64 `query:"tenant_id"`
// Keyword 模板名称或标题关键字,模糊匹配。
Keyword *string `query:"keyword"`
// Type 通知类型过滤。
Type *consts.NotificationType `query:"type"`
// IsActive 是否启用过滤。
IsActive *bool `query:"is_active"`
// CreatedAtFrom 创建时间起始RFC3339
CreatedAtFrom *string `query:"created_at_from"`
// CreatedAtTo 创建时间结束RFC3339
CreatedAtTo *string `query:"created_at_to"`
// Asc 升序字段id/created_at
Asc *string `query:"asc"`
// Desc 降序字段id/created_at
Desc *string `query:"desc"`
}
// SuperNotificationTemplateCreateForm 超管通知模板创建参数。
type SuperNotificationTemplateCreateForm struct {
// TenantID 租户ID不传代表全平台模板
TenantID *int64 `json:"tenant_id"`
// Name 模板名称(用于识别用途)。
Name string `json:"name"`
// Type 通知类型system/order/audit/interaction
Type consts.NotificationType `json:"type"`
// Title 通知标题。
Title string `json:"title"`
// Content 通知内容。
Content string `json:"content"`
// IsActive 是否启用(不传默认启用)。
IsActive *bool `json:"is_active"`
}
// SuperNotificationTemplateItem 超管通知模板条目。
type SuperNotificationTemplateItem 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"`
// Name 模板名称。
Name string `json:"name"`
// Type 通知类型。
Type consts.NotificationType `json:"type"`
// Title 模板标题。
Title string `json:"title"`
// Content 模板内容。
Content string `json:"content"`
// IsActive 是否启用。
IsActive bool `json:"is_active"`
// CreatedAt 创建时间RFC3339
CreatedAt string `json:"created_at"`
// UpdatedAt 更新时间RFC3339
UpdatedAt string `json:"updated_at"`
}