card.go 5.5 KB

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