card.go 6.5 KB

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