700 lines
24 KiB
Go
700 lines
24 KiB
Go
package dto
|
||
|
||
import (
|
||
v1_dto "quyun/v2/app/http/v1/dto"
|
||
"quyun/v2/app/requests"
|
||
"quyun/v2/pkg/consts"
|
||
)
|
||
|
||
// Filters
|
||
type UserListFilter struct {
|
||
requests.Pagination
|
||
// ID 用户ID,精确匹配。
|
||
ID *int64 `query:"id"`
|
||
// TenantID 租户ID,筛选加入该租户的用户。
|
||
TenantID *int64 `query:"tenant_id"`
|
||
// Username 用户名/昵称,模糊匹配。
|
||
Username *string `query:"username"`
|
||
// Status 用户状态过滤。
|
||
Status *consts.UserStatus `query:"status"`
|
||
// Role 角色过滤(roles 包含该角色)。
|
||
Role *consts.Role `query:"role"`
|
||
// CreatedAtFrom 创建时间起始(RFC3339)。
|
||
CreatedAtFrom *string `query:"created_at_from"`
|
||
// CreatedAtTo 创建时间结束(RFC3339)。
|
||
CreatedAtTo *string `query:"created_at_to"`
|
||
// VerifiedAtFrom 认证时间起始(RFC3339)。
|
||
VerifiedAtFrom *string `query:"verified_at_from"`
|
||
// VerifiedAtTo 认证时间结束(RFC3339)。
|
||
VerifiedAtTo *string `query:"verified_at_to"`
|
||
// Asc 升序字段(id/username/status/created_at/verified_at)。
|
||
Asc *string `query:"asc"`
|
||
// Desc 降序字段(id/username/status/created_at/verified_at)。
|
||
Desc *string `query:"desc"`
|
||
}
|
||
|
||
type TenantListFilter struct {
|
||
requests.Pagination
|
||
// ID 租户ID,精确匹配。
|
||
ID *int64 `query:"id"`
|
||
// UserID 租户所有者用户ID,精确匹配。
|
||
UserID *int64 `query:"user_id"`
|
||
// Name 租户名称,模糊匹配。
|
||
Name *string `query:"name"`
|
||
// Code 租户编码,模糊匹配。
|
||
Code *string `query:"code"`
|
||
// Status 租户状态过滤。
|
||
Status *consts.TenantStatus `query:"status"`
|
||
// ExpiredAtFrom 过期时间起始(RFC3339)。
|
||
ExpiredAtFrom *string `query:"expired_at_from"`
|
||
// ExpiredAtTo 过期时间结束(RFC3339)。
|
||
ExpiredAtTo *string `query:"expired_at_to"`
|
||
// CreatedAtFrom 创建时间起始(RFC3339)。
|
||
CreatedAtFrom *string `query:"created_at_from"`
|
||
// CreatedAtTo 创建时间结束(RFC3339)。
|
||
CreatedAtTo *string `query:"created_at_to"`
|
||
// Asc 升序字段(id/name/code/status/expired_at/created_at)。
|
||
Asc *string `query:"asc"`
|
||
// Desc 降序字段(id/name/code/status/expired_at/created_at)。
|
||
Desc *string `query:"desc"`
|
||
}
|
||
|
||
type SuperTenantUserListFilter struct {
|
||
requests.Pagination
|
||
// UserID 用户ID,精确匹配。
|
||
UserID *int64 `query:"user_id"`
|
||
// Username 用户名/昵称,模糊匹配。
|
||
Username *string `query:"username"`
|
||
// Role 成员角色过滤(role 包含该角色)。
|
||
Role *consts.TenantUserRole `query:"role"`
|
||
// Status 成员状态过滤。
|
||
Status *consts.UserStatus `query:"status"`
|
||
}
|
||
|
||
type SuperUserTenantListFilter struct {
|
||
requests.Pagination
|
||
// TenantID 租户ID,精确匹配。
|
||
TenantID *int64 `query:"tenant_id"`
|
||
// Code 租户编码,模糊匹配。
|
||
Code *string `query:"code"`
|
||
// Name 租户名称,模糊匹配。
|
||
Name *string `query:"name"`
|
||
// Role 成员角色过滤(role 包含该角色)。
|
||
Role *consts.TenantUserRole `query:"role"`
|
||
// Status 成员状态过滤。
|
||
Status *consts.UserStatus `query:"status"`
|
||
// CreatedAtFrom 加入时间起始(RFC3339)。
|
||
CreatedAtFrom *string `query:"created_at_from"`
|
||
// CreatedAtTo 加入时间结束(RFC3339)。
|
||
CreatedAtTo *string `query:"created_at_to"`
|
||
// Asc 升序字段(tenant_id/created_at)。
|
||
Asc *string `query:"asc"`
|
||
// Desc 降序字段(tenant_id/created_at)。
|
||
Desc *string `query:"desc"`
|
||
}
|
||
|
||
type SuperContentListFilter 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"`
|
||
// Keyword 标题或摘要关键字,模糊匹配。
|
||
Keyword *string `query:"keyword"`
|
||
// Status 内容状态过滤。
|
||
Status *consts.ContentStatus `query:"status"`
|
||
// Visibility 内容可见性过滤。
|
||
Visibility *consts.ContentVisibility `query:"visibility"`
|
||
// PublishedAtFrom 发布时间起始(RFC3339)。
|
||
PublishedAtFrom *string `query:"published_at_from"`
|
||
// PublishedAtTo 发布时间结束(RFC3339)。
|
||
PublishedAtTo *string `query:"published_at_to"`
|
||
// CreatedAtFrom 创建时间起始(RFC3339)。
|
||
CreatedAtFrom *string `query:"created_at_from"`
|
||
// CreatedAtTo 创建时间结束(RFC3339)。
|
||
CreatedAtTo *string `query:"created_at_to"`
|
||
// PriceAmountMin 价格下限(分)。
|
||
PriceAmountMin *int64 `query:"price_amount_min"`
|
||
// PriceAmountMax 价格上限(分)。
|
||
PriceAmountMax *int64 `query:"price_amount_max"`
|
||
// Asc 升序字段(id/title/published_at/created_at 等)。
|
||
Asc *string `query:"asc"`
|
||
// Desc 降序字段(id/title/published_at/created_at 等)。
|
||
Desc *string `query:"desc"`
|
||
}
|
||
|
||
// SuperContentStatisticsFilter 超管内容统计查询条件。
|
||
type SuperContentStatisticsFilter struct {
|
||
// TenantID 租户ID(不传代表全平台)。
|
||
TenantID *int64 `query:"tenant_id"`
|
||
// StartAt 统计开始时间(RFC3339,可选;默认当前时间往前 7 天)。
|
||
StartAt *string `query:"start_at"`
|
||
// EndAt 统计结束时间(RFC3339,可选;默认当前时间)。
|
||
EndAt *string `query:"end_at"`
|
||
// Granularity 统计粒度(day;目前仅支持 day)。
|
||
Granularity *string `query:"granularity"`
|
||
}
|
||
|
||
type SuperOrderListFilter 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"`
|
||
// ContentID 内容ID,精确匹配。
|
||
ContentID *int64 `query:"content_id"`
|
||
// ContentTitle 内容标题关键字,模糊匹配。
|
||
ContentTitle *string `query:"content_title"`
|
||
// Type 订单类型过滤。
|
||
Type *consts.OrderType `query:"type"`
|
||
// Status 订单状态过滤。
|
||
Status *consts.OrderStatus `query:"status"`
|
||
// IsFlagged 是否标记为问题订单(true/false)。
|
||
IsFlagged *bool `query:"is_flagged"`
|
||
// IsReconciled 是否已完成对账(true/false)。
|
||
IsReconciled *bool `query:"is_reconciled"`
|
||
// CreatedAtFrom 创建时间起始(RFC3339)。
|
||
CreatedAtFrom *string `query:"created_at_from"`
|
||
// CreatedAtTo 创建时间结束(RFC3339)。
|
||
CreatedAtTo *string `query:"created_at_to"`
|
||
// PaidAtFrom 支付时间起始(RFC3339)。
|
||
PaidAtFrom *string `query:"paid_at_from"`
|
||
// PaidAtTo 支付时间结束(RFC3339)。
|
||
PaidAtTo *string `query:"paid_at_to"`
|
||
// AmountPaidMin 实付金额下限(分)。
|
||
AmountPaidMin *int64 `query:"amount_paid_min"`
|
||
// AmountPaidMax 实付金额上限(分)。
|
||
AmountPaidMax *int64 `query:"amount_paid_max"`
|
||
// Asc 升序字段(id/created_at/paid_at/amount_paid 等)。
|
||
Asc *string `query:"asc"`
|
||
// Desc 降序字段(id/created_at/paid_at/amount_paid 等)。
|
||
Desc *string `query:"desc"`
|
||
}
|
||
|
||
// SuperUserLite 用于平台用户列表的轻量级用户信息
|
||
type SuperUserLite struct {
|
||
// ID 用户ID。
|
||
ID int64 `json:"id"`
|
||
// Username 用户名(用于识别/展示)。
|
||
Username string `json:"username"`
|
||
// Roles 用户角色列表。
|
||
Roles []consts.Role `json:"roles"`
|
||
// Status 用户状态。
|
||
Status consts.UserStatus `json:"status"`
|
||
// StatusDescription 状态描述(用于展示)。
|
||
StatusDescription string `json:"status_description"`
|
||
// VerifiedAt 实名认证时间(RFC3339)。
|
||
VerifiedAt string `json:"verified_at"`
|
||
// CreatedAt 创建时间(RFC3339)。
|
||
CreatedAt string `json:"created_at"`
|
||
// UpdatedAt 更新时间(RFC3339)。
|
||
UpdatedAt string `json:"updated_at"`
|
||
}
|
||
|
||
type UserItem struct {
|
||
SuperUserLite
|
||
// Balance 账户可用余额(分)。
|
||
Balance int64 `json:"balance"`
|
||
// BalanceFrozen 账户冻结余额(分)。
|
||
BalanceFrozen int64 `json:"balance_frozen"`
|
||
// OwnedTenantCount 拥有的租户数量。
|
||
OwnedTenantCount int64 `json:"owned_tenant_count"`
|
||
// JoinedTenantCount 加入的租户数量。
|
||
JoinedTenantCount int64 `json:"joined_tenant_count"`
|
||
}
|
||
|
||
type SuperWalletResponse struct {
|
||
// Balance 账户可用余额(分)。
|
||
Balance int64 `json:"balance"`
|
||
// BalanceFrozen 账户冻结余额(分)。
|
||
BalanceFrozen int64 `json:"balance_frozen"`
|
||
// Transactions 最近交易记录。
|
||
Transactions []SuperWalletTransaction `json:"transactions"`
|
||
}
|
||
|
||
type SuperWalletTransaction struct {
|
||
// ID 订单ID。
|
||
ID int64 `json:"id"`
|
||
// OrderType 订单类型。
|
||
OrderType consts.OrderType `json:"order_type"`
|
||
// Title 交易标题。
|
||
Title string `json:"title"`
|
||
// Amount 交易金额(分)。
|
||
Amount int64 `json:"amount"`
|
||
// Type 交易流向(income/expense)。
|
||
Type string `json:"type"`
|
||
// Date 交易时间(RFC3339)。
|
||
Date string `json:"date"`
|
||
// TenantID 交易所属租户ID(充值为0)。
|
||
TenantID int64 `json:"tenant_id"`
|
||
// TenantCode 租户编码。
|
||
TenantCode string `json:"tenant_code"`
|
||
// TenantName 租户名称。
|
||
TenantName string `json:"tenant_name"`
|
||
}
|
||
|
||
type UserStatistics struct {
|
||
// Status 用户状态枚举。
|
||
Status consts.UserStatus `json:"status"`
|
||
// StatusDescription 状态描述(用于展示)。
|
||
StatusDescription string `json:"status_description"`
|
||
// Count 该状态用户数量。
|
||
Count int64 `json:"count"`
|
||
}
|
||
|
||
type UserStatusUpdateForm struct {
|
||
// Status 目标用户状态。
|
||
Status consts.UserStatus `json:"status" validate:"required"`
|
||
}
|
||
|
||
type UserRolesUpdateForm struct {
|
||
// Roles 目标角色列表(至少包含 1 个)。
|
||
Roles []consts.Role `json:"roles" validate:"required,min=1"`
|
||
}
|
||
|
||
type UserTenantItem struct {
|
||
// TenantID 租户ID。
|
||
TenantID int64 `json:"tenant_id"`
|
||
// TenantStatus 租户状态。
|
||
TenantStatus consts.TenantStatus `json:"tenant_status"`
|
||
// TenantStatusDescription 租户状态描述。
|
||
TenantStatusDescription string `json:"tenant_status_description"`
|
||
// Name 租户名称。
|
||
Name string `json:"name"`
|
||
// Code 租户编码。
|
||
Code string `json:"code"`
|
||
// Owner 租户所有者用户信息。
|
||
Owner *TenantOwnerUserLite `json:"owner"`
|
||
// Role 用户在该租户内的角色列表。
|
||
Role []consts.TenantUserRole `json:"role"`
|
||
// MemberStatus 成员状态。
|
||
MemberStatus consts.UserStatus `json:"member_status"`
|
||
// MemberStatusDescription 成员状态描述。
|
||
MemberStatusDescription string `json:"member_status_description"`
|
||
// JoinedAt 加入时间(RFC3339)。
|
||
JoinedAt string `json:"joined_at"`
|
||
// ExpiredAt 租户过期时间(RFC3339)。
|
||
ExpiredAt string `json:"expired_at"`
|
||
}
|
||
|
||
// Tenant Related
|
||
type TenantCreateForm struct {
|
||
// Name 租户名称。
|
||
Name string `json:"name" validate:"required,max=128"`
|
||
// Code 租户编码(唯一)。
|
||
Code string `json:"code" validate:"required,max=64"`
|
||
// AdminUserID 租户管理员用户ID。
|
||
AdminUserID int64 `json:"admin_user_id" validate:"required"`
|
||
// Duration 租户有效期(天)。
|
||
Duration int `json:"duration" validate:"required,oneof=7 30 90 180 365"`
|
||
}
|
||
|
||
type TenantItem struct {
|
||
// ID 租户ID。
|
||
ID int64 `json:"id"`
|
||
// UUID 租户UUID。
|
||
UUID string `json:"uuid"`
|
||
// Code 租户编码。
|
||
Code string `json:"code"`
|
||
// Name 租户名称。
|
||
Name string `json:"name"`
|
||
// Status 租户状态。
|
||
Status consts.TenantStatus `json:"status"`
|
||
// StatusDescription 租户状态描述。
|
||
StatusDescription string `json:"status_description"`
|
||
// Config 租户配置项(占位/需要结构化时替换)。
|
||
Config []int `json:"config"` // Replace with actual config struct if needed
|
||
// Owner 租户所有者信息。
|
||
Owner *TenantOwnerUserLite `json:"owner"`
|
||
// AdminUsers 租户管理员列表。
|
||
AdminUsers []*TenantAdminUserLite `json:"admin_users"`
|
||
// UserCount 租户成员数量。
|
||
UserCount int64 `json:"user_count"`
|
||
// IncomeAmountPaidSum 累计实收金额(分)。
|
||
IncomeAmountPaidSum int64 `json:"income_amount_paid_sum"`
|
||
// ExpiredAt 租户过期时间(RFC3339)。
|
||
ExpiredAt string `json:"expired_at"`
|
||
// CreatedAt 创建时间(RFC3339)。
|
||
CreatedAt string `json:"created_at"`
|
||
// UpdatedAt 更新时间(RFC3339)。
|
||
UpdatedAt string `json:"updated_at"`
|
||
// UserID 创建者用户ID。
|
||
UserID int64 `json:"user_id"`
|
||
// Users 租户成员列表(用于详情展示)。
|
||
Users []*SuperUserLite `json:"users"`
|
||
}
|
||
|
||
type TenantHealthItem struct {
|
||
// TenantID 租户ID。
|
||
TenantID int64 `json:"tenant_id"`
|
||
// Code 租户编码。
|
||
Code string `json:"code"`
|
||
// Name 租户名称。
|
||
Name string `json:"name"`
|
||
// Status 租户状态。
|
||
Status consts.TenantStatus `json:"status"`
|
||
// StatusDescription 租户状态描述(用于展示)。
|
||
StatusDescription string `json:"status_description"`
|
||
// Owner 租户所有者信息。
|
||
Owner *TenantOwnerUserLite `json:"owner"`
|
||
// MemberCount 租户成员数量(包含管理员)。
|
||
MemberCount int64 `json:"member_count"`
|
||
// ContentCount 内容总数。
|
||
ContentCount int64 `json:"content_count"`
|
||
// PublishedContentCount 已发布内容数量。
|
||
PublishedContentCount int64 `json:"published_content_count"`
|
||
// PaidOrders 已支付订单数(内容购买)。
|
||
PaidOrders int64 `json:"paid_orders"`
|
||
// PaidAmount 已支付金额(分)。
|
||
PaidAmount int64 `json:"paid_amount"`
|
||
// RefundOrders 已退款订单数(内容购买)。
|
||
RefundOrders int64 `json:"refund_orders"`
|
||
// RefundAmount 已退款金额(分)。
|
||
RefundAmount int64 `json:"refund_amount"`
|
||
// RefundRate 退款率(退款订单数 / 已支付订单数)。
|
||
RefundRate float64 `json:"refund_rate"`
|
||
// LastPaidAt 最近成交时间(RFC3339,空代表暂无成交)。
|
||
LastPaidAt string `json:"last_paid_at"`
|
||
// HealthLevel 健康等级(healthy/warning/risk)。
|
||
HealthLevel string `json:"health_level"`
|
||
// Alerts 异常提示列表(用于运营侧提示)。
|
||
Alerts []string `json:"alerts"`
|
||
}
|
||
|
||
type TenantOwnerUserLite struct {
|
||
// ID 用户ID。
|
||
ID int64 `json:"id"`
|
||
// Username 用户名。
|
||
Username string `json:"username"`
|
||
}
|
||
|
||
type TenantAdminUserLite struct {
|
||
// ID 用户ID。
|
||
ID int64 `json:"id"`
|
||
// Username 用户名。
|
||
Username string `json:"username"`
|
||
}
|
||
|
||
type TenantExpireUpdateForm struct {
|
||
// Duration 延长有效期(天)。
|
||
Duration int `json:"duration" validate:"required,oneof=7 30 90 180 365"`
|
||
}
|
||
|
||
type TenantStatusUpdateForm struct {
|
||
// Status 目标租户状态。
|
||
Status consts.TenantStatus `json:"status" validate:"required"`
|
||
}
|
||
|
||
type SuperTenantContentItem struct {
|
||
// Content 内容摘要信息。
|
||
Content *v1_dto.ContentItem `json:"content"`
|
||
// StatusDescription 状态描述(用于展示)。
|
||
StatusDescription string `json:"status_description"`
|
||
// VisibilityDescription 可见性描述(用于展示)。
|
||
VisibilityDescription string `json:"visibility_description"`
|
||
// Tenant 内容所属租户信息。
|
||
Tenant *SuperContentTenantLite `json:"tenant"`
|
||
// Owner 内容作者用户信息。
|
||
Owner *SuperUserLite `json:"owner"`
|
||
// Price 内容价格信息。
|
||
Price *v1_dto.ContentPrice `json:"price"`
|
||
}
|
||
|
||
type SuperContentTenantLite struct {
|
||
// ID 租户ID。
|
||
ID int64 `json:"id"`
|
||
// Code 租户编码。
|
||
Code string `json:"code"`
|
||
// Name 租户名称。
|
||
Name string `json:"name"`
|
||
}
|
||
|
||
type SuperTenantContentStatusUpdateForm struct {
|
||
// Status 目标内容状态。
|
||
Status consts.ContentStatus `json:"status" validate:"required,oneof=unpublished blocked"`
|
||
}
|
||
|
||
type SuperContentReviewForm struct {
|
||
// Action 审核动作(approve/reject)。
|
||
Action string `json:"action" validate:"required,oneof=approve reject"`
|
||
// Reason 审核说明(驳回时填写,便于作者修正)。
|
||
Reason string `json:"reason"`
|
||
}
|
||
|
||
type SuperContentBatchReviewForm struct {
|
||
// ContentIDs 待审核内容ID列表。
|
||
ContentIDs []int64 `json:"content_ids" validate:"required,min=1,dive,gt=0"`
|
||
// Action 审核动作(approve/reject)。
|
||
Action string `json:"action" validate:"required,oneof=approve reject"`
|
||
// Reason 审核说明(驳回时填写,便于作者修正)。
|
||
Reason string `json:"reason"`
|
||
}
|
||
|
||
type SuperTenantUserItem struct {
|
||
// User 用户信息。
|
||
User *SuperUserLite `json:"user"`
|
||
// TenantUser 租户成员关系信息。
|
||
TenantUser *TenantUser `json:"tenant_user"`
|
||
}
|
||
|
||
type TenantUser struct {
|
||
// ID 成员记录ID。
|
||
ID int64 `json:"id"`
|
||
// TenantID 租户ID。
|
||
TenantID int64 `json:"tenant_id"`
|
||
// UserID 用户ID。
|
||
UserID int64 `json:"user_id"`
|
||
// Role 成员角色列表。
|
||
Role []consts.TenantUserRole `json:"role"`
|
||
// Status 成员状态。
|
||
Status consts.UserStatus `json:"status"`
|
||
// CreatedAt 创建时间(RFC3339)。
|
||
CreatedAt string `json:"created_at"`
|
||
// UpdatedAt 更新时间(RFC3339)。
|
||
UpdatedAt string `json:"updated_at"`
|
||
}
|
||
|
||
// SuperTenantJoinRequestListFilter 超管成员申请列表过滤条件。
|
||
type SuperTenantJoinRequestListFilter struct {
|
||
requests.Pagination
|
||
// 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"`
|
||
// Status 申请状态(pending/approved/rejected)。
|
||
Status *consts.TenantJoinRequestStatus `query:"status"`
|
||
// CreatedAtFrom 申请时间起始(RFC3339)。
|
||
CreatedAtFrom *string `query:"created_at_from"`
|
||
// CreatedAtTo 申请时间结束(RFC3339)。
|
||
CreatedAtTo *string `query:"created_at_to"`
|
||
}
|
||
|
||
// SuperTenantJoinRequestItem 超管成员申请列表项。
|
||
type SuperTenantJoinRequestItem 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"`
|
||
// Status 申请状态。
|
||
Status string `json:"status"`
|
||
// StatusDescription 状态描述(用于展示)。
|
||
StatusDescription string `json:"status_description"`
|
||
// Reason 申请说明。
|
||
Reason string `json:"reason"`
|
||
// DecidedAt 审核时间(RFC3339)。
|
||
DecidedAt string `json:"decided_at"`
|
||
// DecidedOperatorUserID 审核操作者ID。
|
||
DecidedOperatorUserID int64 `json:"decided_operator_user_id"`
|
||
// DecidedReason 审核备注/原因。
|
||
DecidedReason string `json:"decided_reason"`
|
||
// CreatedAt 申请时间(RFC3339)。
|
||
CreatedAt string `json:"created_at"`
|
||
// UpdatedAt 更新时间(RFC3339)。
|
||
UpdatedAt string `json:"updated_at"`
|
||
}
|
||
|
||
// Order Related
|
||
type SuperOrderItem struct {
|
||
// ID 订单ID。
|
||
ID int64 `json:"id"`
|
||
// Type 订单类型。
|
||
Type consts.OrderType `json:"type"`
|
||
// Status 订单状态。
|
||
Status consts.OrderStatus `json:"status"`
|
||
// StatusDescription 状态描述(用于展示)。
|
||
StatusDescription string `json:"status_description"`
|
||
// Currency 币种。
|
||
Currency consts.Currency `json:"currency"`
|
||
// AmountOriginal 原价金额(分)。
|
||
AmountOriginal int64 `json:"amount_original"`
|
||
// AmountDiscount 优惠金额(分)。
|
||
AmountDiscount int64 `json:"amount_discount"`
|
||
// AmountPaid 实付金额(分)。
|
||
AmountPaid int64 `json:"amount_paid"`
|
||
// Tenant 订单所属租户信息。
|
||
Tenant *OrderTenantLite `json:"tenant"`
|
||
// Buyer 订单买家信息。
|
||
Buyer *OrderBuyerLite `json:"buyer"`
|
||
// Snapshot 订单快照,包含下单时的关键参数与定价信息,便于审计回溯。
|
||
Snapshot any `json:"snapshot"`
|
||
// Items 订单明细行,用于展示具体内容与金额拆分。
|
||
Items []SuperOrderItemLine `json:"items"`
|
||
// PaidAt 支付时间(RFC3339)。
|
||
PaidAt string `json:"paid_at"`
|
||
// RefundedAt 退款时间(RFC3339)。
|
||
RefundedAt string `json:"refunded_at"`
|
||
// IsFlagged 是否标记为问题订单。
|
||
IsFlagged bool `json:"is_flagged"`
|
||
// FlagReason 问题标记原因。
|
||
FlagReason string `json:"flag_reason"`
|
||
// FlaggedBy 标记操作者ID。
|
||
FlaggedBy int64 `json:"flagged_by"`
|
||
// FlaggedAt 标记时间(RFC3339)。
|
||
FlaggedAt string `json:"flagged_at"`
|
||
// IsReconciled 是否完成对账。
|
||
IsReconciled bool `json:"is_reconciled"`
|
||
// ReconcileNote 对账说明。
|
||
ReconcileNote string `json:"reconcile_note"`
|
||
// ReconciledBy 对账操作者ID。
|
||
ReconciledBy int64 `json:"reconciled_by"`
|
||
// ReconciledAt 对账时间(RFC3339)。
|
||
ReconciledAt string `json:"reconciled_at"`
|
||
// CreatedAt 创建时间(RFC3339)。
|
||
CreatedAt string `json:"created_at"`
|
||
// UpdatedAt 更新时间(RFC3339)。
|
||
UpdatedAt string `json:"updated_at"`
|
||
}
|
||
|
||
type OrderTenantLite struct {
|
||
// ID 租户ID。
|
||
ID int64 `json:"id"`
|
||
// Code 租户编码。
|
||
Code string `json:"code"`
|
||
// Name 租户名称。
|
||
Name string `json:"name"`
|
||
}
|
||
|
||
type OrderBuyerLite struct {
|
||
// ID 买家用户ID。
|
||
ID int64 `json:"id"`
|
||
// Username 买家用户名。
|
||
Username string `json:"username"`
|
||
}
|
||
|
||
// SuperOrderItemLine 表示订单明细行。
|
||
type SuperOrderItemLine struct {
|
||
// ID 订单明细ID。
|
||
ID int64 `json:"id"`
|
||
// ContentID 购买的内容ID。
|
||
ContentID int64 `json:"content_id"`
|
||
// AmountPaid 该明细实付金额(分)。
|
||
AmountPaid int64 `json:"amount_paid"`
|
||
// Snapshot 明细快照,用于展示内容标题等历史信息。
|
||
Snapshot any `json:"snapshot"`
|
||
}
|
||
|
||
type OrderStatisticsResponse struct {
|
||
// TotalCount 订单总数。
|
||
TotalCount int64 `json:"total_count"`
|
||
// TotalAmountPaidSum 实付总额(分)。
|
||
TotalAmountPaidSum int64 `json:"total_amount_paid_sum"`
|
||
// ByStatus 按状态聚合统计。
|
||
ByStatus []OrderStatisticsRow `json:"by_status"`
|
||
}
|
||
|
||
type OrderStatisticsRow struct {
|
||
// Status 订单状态。
|
||
Status consts.OrderStatus `json:"status"`
|
||
// StatusDescription 状态描述(用于展示)。
|
||
StatusDescription string `json:"status_description"`
|
||
// Count 该状态订单数量。
|
||
Count int64 `json:"count"`
|
||
// AmountPaidSum 该状态实付总额(分)。
|
||
AmountPaidSum int64 `json:"amount_paid_sum"`
|
||
}
|
||
|
||
type SuperOrderDetail struct {
|
||
// Order 订单详细信息。
|
||
Order *SuperOrderItem `json:"order"` // Using SuperOrderItem as base, extend if needed
|
||
// Tenant 订单所属租户信息。
|
||
Tenant *OrderTenantLite `json:"tenant"`
|
||
// Buyer 订单买家信息。
|
||
Buyer *OrderBuyerLite `json:"buyer"`
|
||
}
|
||
|
||
type SuperOrderRefundForm struct {
|
||
// Force 是否强制退款(忽略部分约束)。
|
||
Force bool `json:"force"`
|
||
// Reason 退款原因说明。
|
||
Reason string `json:"reason"`
|
||
// IdempotencyKey 幂等键(防止重复提交)。
|
||
IdempotencyKey string `json:"idempotency_key"`
|
||
}
|
||
|
||
type SuperOrderFlagForm struct {
|
||
// IsFlagged 是否标记为问题订单。
|
||
IsFlagged bool `json:"is_flagged"`
|
||
// Reason 标记原因(标记为问题时必填)。
|
||
Reason string `json:"reason"`
|
||
}
|
||
|
||
type SuperOrderReconcileForm struct {
|
||
// IsReconciled 是否完成对账。
|
||
IsReconciled bool `json:"is_reconciled"`
|
||
// Note 对账说明(可选)。
|
||
Note string `json:"note"`
|
||
}
|
||
|
||
// AdminContentItem for super admin view
|
||
type AdminContentItem struct {
|
||
// Content 内容摘要信息。
|
||
Content *v1_dto.ContentItem `json:"content"`
|
||
// Owner 内容作者用户信息。
|
||
Owner *AdminContentOwnerLite `json:"owner"`
|
||
// Price 内容价格信息。
|
||
Price *v1_dto.ContentPrice `json:"price"`
|
||
// StatusDescription 状态描述(用于展示)。
|
||
StatusDescription string `json:"status_description"`
|
||
// VisibilityDescription 可见性描述(用于展示)。
|
||
VisibilityDescription string `json:"visibility_description"`
|
||
// Tenant 内容所属租户信息,用于超管列表展示与跳转。
|
||
Tenant *SuperContentTenantLite `json:"tenant"`
|
||
}
|
||
|
||
type AdminContentOwnerLite struct {
|
||
// ID 用户ID。
|
||
ID int64 `json:"id"`
|
||
// Username 用户名。
|
||
Username string `json:"username"`
|
||
// Roles 用户角色列表。
|
||
Roles []consts.Role `json:"roles"`
|
||
// Status 用户状态。
|
||
Status consts.UserStatus `json:"status"`
|
||
}
|
||
|
||
// SuperContentStatisticsResponse 超管内容统计响应。
|
||
type SuperContentStatisticsResponse struct {
|
||
// TotalCount 内容总量。
|
||
TotalCount int64 `json:"total_count"`
|
||
// Trend 按天新增内容趋势。
|
||
Trend []SuperContentTrendItem `json:"trend"`
|
||
}
|
||
|
||
// SuperContentTrendItem 内容新增趋势条目。
|
||
type SuperContentTrendItem struct {
|
||
// Date 日期(YYYY-MM-DD)。
|
||
Date string `json:"date"`
|
||
// CreatedCount 当日新增内容数量。
|
||
CreatedCount int64 `json:"created_count"`
|
||
}
|