card.go 7.7 KB

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