card.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. }
  79. type BuyKnowList struct {
  80. Icon string `json:"icon"`
  81. Title string `json:"title"`
  82. Text string `json:"text"`
  83. }
  84. type ShopData struct {
  85. ImageURL string `json:"imageUrl"`
  86. Name string `json:"name"`
  87. StarRating int `json:"starRating"`
  88. Address string `json:"address"`
  89. Distance string `json:"distance"`
  90. }
  91. type MerchantCardListRequest struct {
  92. OpenId string `json:"open_id"`
  93. PageSize int `json:"page_size"`
  94. PageIndex int `json:"page_index"`
  95. TypeList int `json:"type_list"` //1-未开始 2-进行中 3-已结束
  96. }
  97. type MerchantCardListReply struct {
  98. ID int64 `json:"id"`
  99. MerchantCardName string `json:"merchant_card_name"` // 商户卡名称
  100. MerchantOpenID string `json:"merchant_open_id"` // openid
  101. CardProjectData string `json:"card_project_data"` // 项目
  102. CardPrice string `json:"card_price"` // 单价
  103. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  104. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  105. MerchantCardTime int64 `json:"merchant_card_time"` // 商户卡有效期
  106. Inventory int64 `json:"inventory"` // 库存数量
  107. QuotaNum int64 `json:"quota_num"` // 限购数量
  108. UseRule string `json:"use_rule"` // 使用规则
  109. Picture string `json:"picture"` // 图片
  110. RebateRate int64 `json:"rebate_rate"` // 佣金比例
  111. CreateBy int64 `json:"create_by"` // 创建者
  112. UpdateBy int64 `json:"update_by"` // 更新者
  113. CreatedAt time.Time `json:"created_at"` // 创建时间
  114. UpdatedAt time.Time `json:"updated_at"` // 最后更新时间
  115. DeletedAt time.Time `json:"deleted_at"`
  116. RebateAmount string `json:"rebate_amount"` // 佣金
  117. }
  118. type UpdateMerchantCardRequest struct {
  119. ID int64 `json:"id"`
  120. ActivityEndTime int64 `json:"activity_end_time"` // 活动结束时间
  121. ActivityStartTime int64 `json:"activity_start_time"` // 活动开始时间
  122. Inventory int64 `json:"inventory"` // 库存数量
  123. QuotaNum int64 `json:"quota_num"` // 限购数量
  124. UseRule string `json:"use_rule"` // 使用规则
  125. Picture string `json:"picture"` // 图片
  126. }
  127. type UpdateMerchantCardWHXYRequest struct {
  128. Whxy string `json:"whxy"` //坐标
  129. MerchantCardId int64 `json:"merchant_card_id"`
  130. }
  131. type WHXYStr struct {
  132. Type string `json:"type"`
  133. URL string `json:"url"`
  134. Y decimal.Decimal `json:"y,omitempty"`
  135. X decimal.Decimal `json:"x,omitempty"`
  136. W decimal.Decimal `json:"w,omitempty"`
  137. H decimal.Decimal `json:"h,omitempty"`
  138. //Rotate int `json:"rotate,omitempty"`
  139. //SourceID any `json:"sourceId,omitempty"`
  140. }