feat: implement coupon management and receive flow
This commit is contained in:
@@ -1,5 +1,99 @@
|
||||
package dto
|
||||
|
||||
import "quyun/v2/app/requests"
|
||||
|
||||
type CouponCreateForm struct {
|
||||
// Title 优惠券标题。
|
||||
Title string `json:"title"`
|
||||
// Description 优惠券描述。
|
||||
Description string `json:"description"`
|
||||
// Type 优惠券类型(fix_amount/discount)。
|
||||
Type string `json:"type"`
|
||||
// Value 优惠券面值(分/折扣百分比)。
|
||||
Value int64 `json:"value"`
|
||||
// MinOrderAmount 使用门槛金额(分)。
|
||||
MinOrderAmount int64 `json:"min_order_amount"`
|
||||
// MaxDiscount 折扣券最高抵扣金额(分)。
|
||||
MaxDiscount int64 `json:"max_discount"`
|
||||
// TotalQuantity 发行总量(0 表示不限量)。
|
||||
TotalQuantity int32 `json:"total_quantity"`
|
||||
// StartAt 生效时间(RFC3339,可为空)。
|
||||
StartAt string `json:"start_at"`
|
||||
// EndAt 过期时间(RFC3339,可为空)。
|
||||
EndAt string `json:"end_at"`
|
||||
}
|
||||
|
||||
type CouponUpdateForm struct {
|
||||
// Title 优惠券标题(为空表示不修改)。
|
||||
Title *string `json:"title"`
|
||||
// Description 优惠券描述(为空表示不修改)。
|
||||
Description *string `json:"description"`
|
||||
// Type 优惠券类型(fix_amount/discount)。
|
||||
Type *string `json:"type"`
|
||||
// Value 优惠券面值(分/折扣百分比)。
|
||||
Value *int64 `json:"value"`
|
||||
// MinOrderAmount 使用门槛金额(分)。
|
||||
MinOrderAmount *int64 `json:"min_order_amount"`
|
||||
// MaxDiscount 折扣券最高抵扣金额(分)。
|
||||
MaxDiscount *int64 `json:"max_discount"`
|
||||
// TotalQuantity 发行总量(0 表示不限量)。
|
||||
TotalQuantity *int32 `json:"total_quantity"`
|
||||
// StartAt 生效时间(RFC3339,可为空)。
|
||||
StartAt *string `json:"start_at"`
|
||||
// EndAt 过期时间(RFC3339,可为空)。
|
||||
EndAt *string `json:"end_at"`
|
||||
}
|
||||
|
||||
type CouponItem struct {
|
||||
// ID 券模板ID。
|
||||
ID int64 `json:"id"`
|
||||
// Title 优惠券标题。
|
||||
Title string `json:"title"`
|
||||
// Description 优惠券描述。
|
||||
Description string `json:"description"`
|
||||
// Type 优惠券类型(fix_amount/discount)。
|
||||
Type string `json:"type"`
|
||||
// Value 优惠券面值(分/折扣百分比)。
|
||||
Value int64 `json:"value"`
|
||||
// MinOrderAmount 使用门槛金额(分)。
|
||||
MinOrderAmount int64 `json:"min_order_amount"`
|
||||
// MaxDiscount 折扣券最高抵扣金额(分)。
|
||||
MaxDiscount int64 `json:"max_discount"`
|
||||
// TotalQuantity 发行总量。
|
||||
TotalQuantity int32 `json:"total_quantity"`
|
||||
// UsedQuantity 已使用数量。
|
||||
UsedQuantity int32 `json:"used_quantity"`
|
||||
// StartAt 生效时间(RFC3339)。
|
||||
StartAt string `json:"start_at"`
|
||||
// EndAt 过期时间(RFC3339)。
|
||||
EndAt string `json:"end_at"`
|
||||
// CreatedAt 创建时间(RFC3339)。
|
||||
CreatedAt string `json:"created_at"`
|
||||
// UpdatedAt 更新时间(RFC3339)。
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
type CouponListFilter struct {
|
||||
// Pagination 分页参数(page/limit)。
|
||||
requests.Pagination
|
||||
// Type 优惠券类型过滤。
|
||||
Type *string `query:"type"`
|
||||
// Status 状态过滤(active/expired)。
|
||||
Status *string `query:"status"`
|
||||
// Keyword 关键词搜索(标题/描述)。
|
||||
Keyword *string `query:"keyword"`
|
||||
}
|
||||
|
||||
type CouponReceiveForm struct {
|
||||
// CouponID 券模板ID。
|
||||
CouponID int64 `json:"coupon_id"`
|
||||
}
|
||||
|
||||
type CouponGrantForm struct {
|
||||
// UserIDs 领取用户ID集合。
|
||||
UserIDs []int64 `json:"user_ids"`
|
||||
}
|
||||
|
||||
type UserCouponItem struct {
|
||||
// ID 用户券ID。
|
||||
ID int64 `json:"id"`
|
||||
|
||||
Reference in New Issue
Block a user