feat: 通用授权后台、离线证、Waffo 支付页与仪表盘加强
支持多产品计划展示、LICOFF 离线签发、支付独立配置与调试,以及分析看板;同步更新 README 与集成文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
0966375076
commit
8cc2c83f9d
41 files changed
+3177
-332
No files matched your search
@@ -2,14 +2,30 @@ package dto
|
||||
|
||||
// DashboardStats 仪表板统计响应 // Logan.Li
|
||||
type DashboardStats struct {
|
||||
TotalLicenses int64 `json:"total_licenses"`
|
||||
ActiveLicenses int64 `json:"active_licenses"`
|
||||
NewThisMonth int64 `json:"new_this_month"`
|
||||
ExpiringSoon int64 `json:"expiring_soon"`
|
||||
TotalCustomers int64 `json:"total_customers"`
|
||||
TotalProducts int64 `json:"total_products"`
|
||||
OnlineDevices int64 `json:"online_devices"`
|
||||
MonthlyRevenue float64 `json:"monthly_revenue"`
|
||||
TotalLicenses int64 `json:"total_licenses"`
|
||||
ActiveLicenses int64 `json:"active_licenses"`
|
||||
ExpiredLicenses int64 `json:"expired_licenses"`
|
||||
OfflineLicenses int64 `json:"offline_licenses"`
|
||||
OnlineLicenses int64 `json:"online_licenses"`
|
||||
NewThisMonth int64 `json:"new_this_month"`
|
||||
ExpiringSoon int64 `json:"expiring_soon"`
|
||||
TotalCustomers int64 `json:"total_customers"`
|
||||
TotalProducts int64 `json:"total_products"`
|
||||
OnlineDevices int64 `json:"online_devices"` // 当前在线用户/设备(5 分钟心跳)
|
||||
MonthlyRevenue float64 `json:"monthly_revenue"`
|
||||
TotalRevenue float64 `json:"total_revenue"`
|
||||
}
|
||||
|
||||
// GeoDistribution 地理/网络分布(基于激活 IP / device_info) // Logan.Li
|
||||
type GeoDistribution struct {
|
||||
Region string `json:"region"`
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
// PlatformDistribution 客户端形态分布(web / pc / mobile / unknown) // Logan.Li
|
||||
type PlatformDistribution struct {
|
||||
Platform string `json:"platform"`
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
// ExpiringLicenseItem 即将到期 License // Logan.Li
|
||||
@@ -51,6 +67,13 @@ type ProductDistribution struct {
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
|
||||
// LicenseGrowthDetailPoint License 增长明细(累计 + 当月新增) // Logan.Li
|
||||
type LicenseGrowthDetailPoint struct {
|
||||
Date string `json:"date"`
|
||||
Cumulative int64 `json:"cumulative"`
|
||||
Created int64 `json:"created"`
|
||||
}
|
||||
|
||||
// SettingUpdate 更新系统设置请求 // Logan.Li
|
||||
type SettingUpdate struct {
|
||||
SystemName *string `json:"system_name"`
|
||||
@@ -61,6 +84,74 @@ type SettingUpdate struct {
|
||||
LogRetentionDays *int `json:"log_retention_days"`
|
||||
}
|
||||
|
||||
// WaffoProductMapping 计划 key → Waffo Product ID(前端 Payments 可扩展表格) // Logan.Li
|
||||
type WaffoProductMapping struct {
|
||||
PlanKey string `json:"plan_key"`
|
||||
Label string `json:"label,omitempty"`
|
||||
ProductID string `json:"product_id"`
|
||||
}
|
||||
|
||||
// WaffoSettingsResponse 管理端 Waffo 配置(私钥不回显) // Logan.Li
|
||||
type WaffoSettingsResponse struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
MerchantID string `json:"merchant_id"`
|
||||
StoreID string `json:"store_id"`
|
||||
StoreSlug string `json:"store_slug"`
|
||||
Environment string `json:"environment"` // test | live
|
||||
SandboxMode bool `json:"sandbox_mode"`
|
||||
Currency string `json:"currency"`
|
||||
ProductID string `json:"product_id"`
|
||||
ProductIDYearly string `json:"product_id_yearly"`
|
||||
ProductIDPerpetual string `json:"product_id_perpetual"`
|
||||
ProductIDs map[string]string `json:"product_ids"` // 可扩展 plan_type → PROD_xxx // Logan.Li
|
||||
ProductMappings []WaffoProductMapping `json:"product_mappings"` // 与前端表格对齐 // Logan.Li
|
||||
SuccessURL string `json:"success_url"`
|
||||
WebhookURL string `json:"webhook_url"`
|
||||
PrivateKeyConfigured bool `json:"private_key_configured"`
|
||||
SourceHint string `json:"source_hint"` // db | env | mixed
|
||||
}
|
||||
|
||||
// WaffoSettingsUpdate 管理端更新 Waffo 配置;private_key 空=保留原值 // Logan.Li
|
||||
type WaffoSettingsUpdate struct {
|
||||
Enabled *bool `json:"enabled"`
|
||||
MerchantID string `json:"merchant_id"`
|
||||
StoreID string `json:"store_id"`
|
||||
StoreSlug string `json:"store_slug"`
|
||||
Environment string `json:"environment"` // test | live | prod
|
||||
Currency string `json:"currency"`
|
||||
ProductID string `json:"product_id"`
|
||||
ProductIDYearly string `json:"product_id_yearly"`
|
||||
ProductIDPerpetual string `json:"product_id_perpetual"`
|
||||
ProductIDs map[string]string `json:"product_ids"` // 可扩展映射;与 yearly/perpetual 合并 // Logan.Li
|
||||
ProductMappings []WaffoProductMapping `json:"product_mappings"` // 前端表格主数据源 // Logan.Li
|
||||
SuccessURL string `json:"success_url"`
|
||||
PrivateKey string `json:"private_key"` // 仅写入;GET 永不返回
|
||||
ClearPrivateKey bool `json:"clear_private_key"`
|
||||
}
|
||||
|
||||
// WaffoDebugRequest 用当前配置探测 create-session(可覆盖 plan/product) // Logan.Li
|
||||
type WaffoDebugRequest struct {
|
||||
PlanType string `json:"plan_type"` // yearly | perpetual | …,默认 yearly
|
||||
ProductID string `json:"product_id"` // 可选覆盖
|
||||
BuyerEmail string `json:"buyer_email"` // 可选
|
||||
}
|
||||
|
||||
// WaffoDebugResponse 调试结果摘要(绝不含私钥) // Logan.Li
|
||||
type WaffoDebugResponse struct {
|
||||
OK bool `json:"ok"`
|
||||
AuthMode string `json:"auth_mode"` // api_key | store_slug | none
|
||||
Environment string `json:"environment"`
|
||||
PlanType string `json:"plan_type"`
|
||||
ProductIDUsed string `json:"product_id_used"`
|
||||
HTTPStatus int `json:"http_status,omitempty"`
|
||||
SessionID string `json:"session_id,omitempty"`
|
||||
CheckoutURLHost string `json:"checkout_url_host,omitempty"` // 仅 host,避免整链噪音
|
||||
ErrorSummary string `json:"error_summary,omitempty"`
|
||||
PrivateKeyPresent bool `json:"private_key_present"`
|
||||
MerchantIDPresent bool `json:"merchant_id_present"`
|
||||
StoreSlugPresent bool `json:"store_slug_present"`
|
||||
}
|
||||
|
||||
// AuditLogResponse 操作日志响应 // Logan.Li
|
||||
type AuditLogResponse struct {
|
||||
ID uint `json:"id"`
|
||||
|
||||
Reference in new issue
Block a user