card.go 8.6 KB

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