card.go 6.8 KB

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