card.go 6.6 KB

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