card.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. package models
  2. import (
  3. "github.com/shopspring/decimal"
  4. "time"
  5. )
  6. type CreateMerchantCardRequest struct {
  7. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  8. MerchantOpenID string `json:"open_id"` // openid
  9. CardProjectData []int64 `json:"card_project_data"` // 项目
  10. CardPrice string `json:"card_price"` // 单价
  11. ActivityEndTime string `json:"activity_end_time"` // 活动结束时间
  12. ActivityStartTime string `json:"activity_start_time"` // 活动开始时间
  13. MerchantCardTime string `json:"merchant_card_time"` // 商户卡有效期
  14. Inventory string `json:"inventory"` // 库存数量
  15. QuotaNum string `json:"quota_num"` // 限购数量
  16. UseRule string `json:"use_rule"` // 使用规则
  17. Picture string `json:"picture"` // 图片
  18. RebateRate string `json:"rebate_rate"` // 佣金比例
  19. }
  20. type GetMerchantCardRequest struct {
  21. MerchantId int64 `json:"merchant_card_id"` //商户卡id
  22. }
  23. type GetMerchantCardReply struct {
  24. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  25. MerchantOpenID string `json:"merchant_open_id"` // openid
  26. CardProjectData string `json:"card_project_data"` // 项目
  27. CardPrice string `json:"card_price"` // 单价
  28. ActivityEndTime string `json:"activity_end_time"` // 活动结束时间
  29. ActivityStartTime string `json:"activity_start_time"` // 活动开始时间
  30. MerchantCardTime string `json:"merchant_card_time"` // 商户卡有效期
  31. Inventory int64 `json:"inventory"` // 库存数量
  32. QuotaNum int64 `json:"quota_num"` // 限购数量
  33. UseRule string `json:"use_rule"` // 使用规则
  34. Picture string `json:"picture"` // 图片
  35. RebateRate int64 `json:"rebate_rate"`
  36. }
  37. // 画布详情
  38. type GetMerchantCanvasCardReply struct {
  39. Static Static `json:"static"`
  40. SwiperList []SwiperList `json:"swiperList"`
  41. RightButton []RightButton `json:"rightButton"`
  42. DataList []DataList `json:"dataList"`
  43. BuyKnowList []BuyKnowList `json:"buyKnowList"`
  44. ShopData ShopData `json:"shopData"`
  45. Base64Img string `json:"base64Img"`
  46. FenxiangShow bool `json:"fenxiangShow"`
  47. MerchantAmount decimal.Decimal `json:"merchantAmount"`
  48. MerchantOriginalAmount decimal.Decimal `json:"merchantOriginalAmount"`
  49. Inventory int64 `json:"inventory"`
  50. }
  51. type Static struct {
  52. Background string `json:"background"`
  53. }
  54. type SwiperList struct {
  55. ID int `json:"id"`
  56. URL string `json:"url"`
  57. }
  58. type RightButton struct {
  59. ImageURL string `json:"imageUrl"`
  60. }
  61. type DataList struct {
  62. Name string `json:"name"`
  63. Count int `json:"count"`
  64. Price string `json:"price"`
  65. }
  66. type BuyKnowList struct {
  67. Icon string `json:"icon"`
  68. Title string `json:"title"`
  69. Text string `json:"text"`
  70. }
  71. type ShopData struct {
  72. ImageURL string `json:"imageUrl"`
  73. Name string `json:"name"`
  74. StarRating int `json:"starRating"`
  75. Address string `json:"address"`
  76. Distance string `json:"distance"`
  77. }
  78. type MerchantCardListRequest struct {
  79. OpenId string `json:"open_id"`
  80. PageSize int `json:"page_size"`
  81. PageIndex int `json:"page_index"`
  82. TypeList int `json:"type_list"` //1-未开始 2-进行中 3-已结束
  83. }
  84. type MerchantCardListReply struct {
  85. ID int64 `json:"id"`
  86. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  87. MerchantOpenID string `json:"merchant_open_id"` // openid
  88. CardProjectData string `json:"card_project_data"` // 项目
  89. CardPrice string `json:"card_price"` // 单价
  90. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  91. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  92. MerchantCardTime int64 `json:"merchant_card_time"` // 商户卡有效期
  93. Inventory int64 `json:"inventory"` // 库存数量
  94. QuotaNum int64 `json:"quota_num"` // 限购数量
  95. UseRule string `json:"use_rule"` // 使用规则
  96. Picture string `json:"picture"` // 图片
  97. RebateRate int64 `json:"rebate_rate"` // 佣金比例
  98. CreateBy int64 `json:"create_by"` // 创建者
  99. UpdateBy int64 `json:"update_by"` // 更新者
  100. CreatedAt time.Time `json:"created_at"` // 创建时间
  101. UpdatedAt time.Time `json:"updated_at"` // 最后更新时间
  102. DeletedAt time.Time `json:"deleted_at"`
  103. RebateAmount string `json:"rebate_amount"` // 佣金
  104. }
  105. type UpdateMerchantCardRequest struct {
  106. ID int64 `json:"id"`
  107. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  108. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  109. Inventory int64 `json:"inventory"` // 库存数量
  110. QuotaNum int64 `json:"quota_num"` // 限购数量
  111. UseRule string `json:"use_rule"` // 使用规则
  112. Picture string `json:"picture"` // 图片
  113. }