You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.4 KiB
Go
60 lines
2.4 KiB
Go
package coupon
|
|
|
|
import (
|
|
"cls/internal/domain/coupon"
|
|
"time"
|
|
)
|
|
|
|
type CouponDto struct {
|
|
Id uint64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Type coupon.CouponType `json:"type"`
|
|
Value int64 `json:"value"`
|
|
MinAmount int64 `json:"minAmount"`
|
|
StartTime time.Time `json:"startTime"`
|
|
EndTime time.Time `json:"endTime"`
|
|
Status coupon.CouponStatus `json:"status"`
|
|
AdminId uint64 `json:"adminId"`
|
|
UserId uint64 `json:"userId"`
|
|
}
|
|
|
|
// CreateCouponRequest 创建优惠券请求
|
|
type CreateCouponRequest struct {
|
|
Name string `json:"name"` // 优惠券名称
|
|
Type int `json:"type"` // 优惠券类型
|
|
Value int64 `json:"value"` // 优惠券值
|
|
MinAmount int64 `json:"minAmount"` // 最低使用金额
|
|
StartTime time.Time `json:"startTime"` // 开始时间
|
|
EndTime time.Time `json:"endTime"` // 结束时间
|
|
TotalCount int `json:"totalCount"` // 总数量
|
|
}
|
|
|
|
// GetUserCouponsResponse 获取用户优惠券响应
|
|
type GetUserCouponsResponse struct {
|
|
ID uint64 `json:"id"` // 优惠券ID
|
|
Code string `json:"code"` // 优惠券码
|
|
Name string `json:"name"` // 优惠券名称
|
|
Type int `json:"type"` // 优惠券类型
|
|
Value int64 `json:"value"` // 优惠券值
|
|
MinAmount int64 `json:"minAmount"` // 最低使用金额
|
|
StartTime time.Time `json:"startTime"` // 开始时间
|
|
EndTime time.Time `json:"endTime"` // 结束时间
|
|
Status int `json:"status"` // 优惠券状态
|
|
UsedAt *time.Time `json:"usedAt"` // 使用时间
|
|
}
|
|
|
|
// GetCouponResponse 获取优惠券响应
|
|
type GetCouponResponse struct {
|
|
ID uint64 `json:"id"` // 优惠券ID
|
|
Code string `json:"code"` // 优惠券码
|
|
Name string `json:"name"` // 优惠券名称
|
|
Type int `json:"type"` // 优惠券类型
|
|
Value int64 `json:"value"` // 优惠券值
|
|
MinAmount int64 `json:"minAmount"` // 最低使用金额
|
|
StartTime time.Time `json:"startTime"` // 开始时间
|
|
EndTime time.Time `json:"endTime"` // 结束时间
|
|
TotalCount int `json:"totalCount"` // 总数量
|
|
UsedCount int `json:"usedCount"` // 已使用数量
|
|
Status int `json:"status"` // 优惠券状态
|
|
}
|