-
Notifications
You must be signed in to change notification settings - Fork 9
/
MjsPromotion.go
106 lines (101 loc) · 5.29 KB
/
MjsPromotion.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package promotion
import (
"sync"
)
// MjsPromotion 结构体
type MjsPromotion struct {
// 活动名称。
Name string `json:"name,omitempty" xml:"name,omitempty"`
// 活动的有效条件、人群和行为描述。
Description string `json:"description,omitempty" xml:"description,omitempty"`
// 活动开始时间。
StartTime string `json:"start_time,omitempty" xml:"start_time,omitempty"`
// 活动结束时间。
EndTime string `json:"end_time,omitempty" xml:"end_time,omitempty"`
// 用户标签。当is_user_tag为true时,该值才有意义。
UserTag string `json:"user_tag,omitempty" xml:"user_tag,omitempty"`
// 礼品名称。当is_send_gift为true时,该值才有意义。
GiftName string `json:"gift_name,omitempty" xml:"gift_name,omitempty"`
// 商品详情的url,当is_send_gift为true时,该值才有效。
GiftUrl string `json:"gift_url,omitempty" xml:"gift_url,omitempty"`
// 免邮的排除地区,即,除指定地区外,其他地区包邮。当is_free_post为true时,该值才有意义。代码使用*链接,代码为行政区划代码。
ExcludeArea string `json:"exclude_area,omitempty" xml:"exclude_area,omitempty"`
// 活动id
ActivityId int64 `json:"activity_id,omitempty" xml:"activity_id,omitempty"`
// 活动类型: 1表示商品级别的活动;2表示店铺级别的活动。
Type int64 `json:"type,omitempty" xml:"type,omitempty"`
// 活动范围:0表示全部参与; 1表示部分商品参与。
ParticipateRange int64 `json:"participate_range,omitempty" xml:"participate_range,omitempty"`
// 满多少元。当is_amount_over为true时,该才字段有意义。注意:单位是分,即10000表示100元。
TotalPrice int64 `json:"total_price,omitempty" xml:"total_price,omitempty"`
// 满多少件。当is_item_count_over为true时,该值才有意义。
ItemCount int64 `json:"item_count,omitempty" xml:"item_count,omitempty"`
// 店铺会员等级,当is_shop_member为true时,该值才有意义。0:店铺客户;1:普通客户;2:高级会员;3:VIP会员; 4:至尊VIP会员。
ShopMemberLevel int64 `json:"shop_member_level,omitempty" xml:"shop_member_level,omitempty"`
// 减多少钱。当is_decrease_money为true时,该值才有意义。注意:该值单位为分,即100表示1元。
DecreaseAmount int64 `json:"decrease_amount,omitempty" xml:"decrease_amount,omitempty"`
// 折扣值。当is_discount为true时,该值才有意义。注意:800表示8折。
DiscountRate int64 `json:"discount_rate,omitempty" xml:"discount_rate,omitempty"`
// 礼品id,当is_send_gift为true时,该值才有意义。<br/>1)只有填写真实的淘宝商品id时,才能生成物流单,并且在确定订单的页面上可以点击该商品名称跳转到商品详情页面。2)当礼物为实物商品时(有宝贝id),礼物必须为上架商品,不能为虚拟商品,不能为拍卖商品,不能有sku,不符合条件的,不做为礼物。
GiftId int64 `json:"gift_id,omitempty" xml:"gift_id,omitempty"`
// 是否有满元条件。
IsAmountOver bool `json:"is_amount_over,omitempty" xml:"is_amount_over,omitempty"`
// 满元是否上不封顶。当is_amount_over为true时,该值才有意义。当该值为true时,表示满元上不封顶,例如满100元减10元,当满200时,则减20元。。。
IsAmountMultiple bool `json:"is_amount_multiple,omitempty" xml:"is_amount_multiple,omitempty"`
// 是否有满件条件。
IsItemCountOver bool `json:"is_item_count_over,omitempty" xml:"is_item_count_over,omitempty"`
// 满件是否上不封顶。当is_amount_multiple为true时,该值才有意义。当该值为true时,表示满件上不封顶,例如满10件减2元,当满20件时,则减4元。。。
IsItemMultiple bool `json:"is_item_multiple,omitempty" xml:"is_item_multiple,omitempty"`
// 是否有店铺会员等级条件。
IsShopMember bool `json:"is_shop_member,omitempty" xml:"is_shop_member,omitempty"`
// 是否指定用户标签。
IsUserTag bool `json:"is_user_tag,omitempty" xml:"is_user_tag,omitempty"`
// 是否有减钱行为。
IsDecreaseMoney bool `json:"is_decrease_money,omitempty" xml:"is_decrease_money,omitempty"`
// 是否有打折行为。
IsDiscount bool `json:"is_discount,omitempty" xml:"is_discount,omitempty"`
// 是否有送礼品行为。
IsSendGift bool `json:"is_send_gift,omitempty" xml:"is_send_gift,omitempty"`
// 是否有免邮行为。
IsFreePost bool `json:"is_free_post,omitempty" xml:"is_free_post,omitempty"`
}
var poolMjsPromotion = sync.Pool{
New: func() any {
return new(MjsPromotion)
},
}
// GetMjsPromotion() 从对象池中获取MjsPromotion
func GetMjsPromotion() *MjsPromotion {
return poolMjsPromotion.Get().(*MjsPromotion)
}
// ReleaseMjsPromotion 释放MjsPromotion
func ReleaseMjsPromotion(v *MjsPromotion) {
v.Name = ""
v.Description = ""
v.StartTime = ""
v.EndTime = ""
v.UserTag = ""
v.GiftName = ""
v.GiftUrl = ""
v.ExcludeArea = ""
v.ActivityId = 0
v.Type = 0
v.ParticipateRange = 0
v.TotalPrice = 0
v.ItemCount = 0
v.ShopMemberLevel = 0
v.DecreaseAmount = 0
v.DiscountRate = 0
v.GiftId = 0
v.IsAmountOver = false
v.IsAmountMultiple = false
v.IsItemCountOver = false
v.IsItemMultiple = false
v.IsShopMember = false
v.IsUserTag = false
v.IsDecreaseMoney = false
v.IsDiscount = false
v.IsSendGift = false
v.IsFreePost = false
poolMjsPromotion.Put(v)
}