code.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package model
  2. // CouponCode coupon code.
  3. type CouponCode struct {
  4. ID int64
  5. BatchToken string
  6. State int32
  7. Code string
  8. Mid int64
  9. CouponType int32
  10. CouponToken string
  11. Ver int64
  12. }
  13. //Token get token .
  14. type Token struct {
  15. Token string `json:"token"`
  16. URL string `json:"url"`
  17. }
  18. // ArgUseCouponCode arg use coupon code.
  19. type ArgUseCouponCode struct {
  20. Token string `form:"token" validate:"required"`
  21. Code string `form:"code" validate:"required"`
  22. Verify string `form:"verify" validate:"required"`
  23. IP string
  24. Mid int64
  25. }
  26. // UseCouponCodeResp use coupon code resp.
  27. type UseCouponCodeResp struct {
  28. CouponToken string `json:"coupon_token"`
  29. CouponAmount float64 `json:"coupon_amount"`
  30. FullAmount float64 `json:"full_amount"`
  31. PlatfromLimitExplain string `json:"platfrom_limit_explain"`
  32. ProductLimitMonth int32 `json:"product_limit_month"`
  33. ProductLimitRenewal int32 `json:"product_limit_renewal"`
  34. }
  35. // coupon code state.
  36. const (
  37. CodeStateNotUse = iota + 1
  38. CodeStateUsed
  39. CodeStateBlock
  40. )