Files
tyapi-server/internal/application/product/dto/commands/subscription_commands.go

22 lines
1.2 KiB
Go
Raw Normal View History

2025-07-15 13:21:34 +08:00
package commands
// CreateSubscriptionCommand 创建订阅命令
type CreateSubscriptionCommand struct {
2025-07-20 20:53:26 +08:00
UserID string `json:"-" comment:"用户ID"`
ProductID string `json:"-" uri:"id" binding:"required,uuid" comment:"产品ID"`
2025-07-15 13:21:34 +08:00
}
2025-07-20 20:53:26 +08:00
// UpdateSubscriptionPriceCommand 更新订阅价格命令
type UpdateSubscriptionPriceCommand struct {
ID string `json:"-" uri:"id" binding:"required,uuid" comment:"订阅ID"`
Price float64 `json:"price" binding:"price,min=0" comment:"订阅价格"`
2025-08-23 16:30:34 +08:00
}
// BatchUpdateSubscriptionPricesCommand 批量更新订阅价格命令
type BatchUpdateSubscriptionPricesCommand struct {
2025-11-13 21:28:08 +08:00
UserID string `json:"user_id" binding:"required,uuid" comment:"用户ID"`
AdjustmentType string `json:"adjustment_type" binding:"required,oneof=discount cost_multiple" comment:"调整方式(discount:按售价折扣,cost_multiple:按成本价倍数)"`
Discount float64 `json:"discount,omitempty" binding:"omitempty,min=0.1,max=10" comment:"折扣比例(0.1-10折)"`
CostMultiple float64 `json:"cost_multiple,omitempty" binding:"omitempty,min=0.1" comment:"成本价倍数"`
Scope string `json:"scope" binding:"required,oneof=undiscounted all" comment:"改价范围(undiscounted:仅未打折,all:所有)"`
2025-07-15 13:21:34 +08:00
}