This commit is contained in:
2025-07-20 20:53:26 +08:00
parent 83bf9aea7d
commit 8ad1d7288e
158 changed files with 18156 additions and 13188 deletions

View File

@@ -2,56 +2,12 @@ package commands
// CreateSubscriptionCommand 创建订阅命令
type CreateSubscriptionCommand struct {
UserID string `json:"user_id" binding:"required" comment:"用户ID"`
ProductID string `json:"product_id" binding:"required" comment:"产品ID"`
Price float64 `json:"price" binding:"min=0" comment:"订阅价格"`
APILimit int64 `json:"api_limit" comment:"API调用限制"`
AutoRenew bool `json:"auto_renew" comment:"是否自动续费"`
Duration string `json:"duration" comment:"订阅时长"`
UserID string `json:"-" comment:"用户ID"`
ProductID string `json:"-" uri:"id" binding:"required,uuid" comment:"产品ID"`
}
// UpdateSubscriptionCommand 更新订阅命令
type UpdateSubscriptionCommand struct {
ID string `json:"-"`
Price float64 `json:"price" binding:"min=0" comment:"订阅价格"`
APILimit int64 `json:"api_limit" comment:"API调用限制"`
AutoRenew *bool `json:"auto_renew" comment:"是否自动续费"`
}
// CancelSubscriptionCommand 取消订阅命令
type CancelSubscriptionCommand struct {
ID string `json:"-"`
}
// RenewSubscriptionCommand 续费订阅命令
type RenewSubscriptionCommand struct {
ID string `json:"-"`
Duration string `json:"duration" binding:"required" comment:"续费时长"`
}
// ActivateSubscriptionCommand 激活订阅命令
type ActivateSubscriptionCommand struct {
ID string `json:"-"`
}
// DeactivateSubscriptionCommand 停用订阅命令
type DeactivateSubscriptionCommand struct {
ID string `json:"-"`
}
// UpdateAPIUsageCommand 更新API使用量命令
type UpdateAPIUsageCommand struct {
ID string `json:"-"`
APIUsed int64 `json:"api_used" binding:"min=0" comment:"API使用量"`
}
// ResetAPIUsageCommand 重置API使用量命令
type ResetAPIUsageCommand struct {
ID string `json:"-"`
}
// SetAPILimitCommand 设置API限制命令
type SetAPILimitCommand struct {
ID string `json:"-"`
APILimit int64 `json:"api_limit" binding:"min=0" comment:"API调用限制"`
// UpdateSubscriptionPriceCommand 更新订阅价格命令
type UpdateSubscriptionPriceCommand struct {
ID string `json:"-" uri:"id" binding:"required,uuid" comment:"订阅ID"`
Price float64 `json:"price" binding:"price,min=0" comment:"订阅价格"`
}