card.go 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. }
  50. type Static struct {
  51. Background string `json:"background"`
  52. }
  53. type SwiperList struct {
  54. ID int `json:"id"`
  55. URL string `json:"url"`
  56. }
  57. type RightButton struct {
  58. ImageURL string `json:"imageUrl"`
  59. }
  60. type DataList struct {
  61. Name string `json:"name"`
  62. Count int `json:"count"`
  63. Price string `json:"price"`
  64. }
  65. type BuyKnowList struct {
  66. Icon string `json:"icon"`
  67. Title string `json:"title"`
  68. Text string `json:"text"`
  69. }
  70. type ShopData struct {
  71. ImageURL string `json:"imageUrl"`
  72. Name string `json:"name"`
  73. StarRating int `json:"starRating"`
  74. Address string `json:"address"`
  75. Distance string `json:"distance"`
  76. }
  77. type MerchantCardListRequest struct {
  78. OpenId string `json:"open_id"`
  79. PageSize int `json:"page_size"`
  80. PageIndex int `json:"page_index"`
  81. TypeList int `json:"type_list"` //1-未开始 2-进行中 3-已结束
  82. }
  83. type MerchantCardListReply struct {
  84. ID int64 `json:"id"`
  85. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  86. MerchantOpenID string `json:"merchant_open_id"` // openid
  87. CardProjectData string `json:"card_project_data"` // 项目
  88. CardPrice string `json:"card_price"` // 单价
  89. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  90. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  91. MerchantCardTime int64 `json:"merchant_card_time"` // 商户卡有效期
  92. Inventory int64 `json:"inventory"` // 库存数量
  93. QuotaNum int64 `json:"quota_num"` // 限购数量
  94. UseRule string `json:"use_rule"` // 使用规则
  95. Picture string `json:"picture"` // 图片
  96. RebateRate int64 `json:"rebate_rate"` // 佣金比例
  97. CreateBy int64 `json:"create_by"` // 创建者
  98. UpdateBy int64 `json:"update_by"` // 更新者
  99. CreatedAt time.Time `json:"created_at"` // 创建时间
  100. UpdatedAt time.Time `json:"updated_at"` // 最后更新时间
  101. DeletedAt time.Time `json:"deleted_at"`
  102. RebateAmount string `json:"rebate_amount"` // 佣金
  103. }
  104. type UpdateMerchantCardRequest struct {
  105. ID int64 `json:"id"`
  106. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  107. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  108. Inventory int64 `json:"inventory"` // 库存数量
  109. QuotaNum int64 `json:"quota_num"` // 限购数量
  110. UseRule string `json:"use_rule"` // 使用规则
  111. Picture string `json:"picture"` // 图片
  112. }