card.go 5.5 KB

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