-
Notifications
You must be signed in to change notification settings - Fork 9
/
Rate.go
118 lines (113 loc) · 4.58 KB
/
Rate.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
107
108
109
110
111
112
113
114
115
116
117
118
package hotel
import (
"sync"
)
// Rate 结构体
type Rate struct {
// 餐食信息
Breakfast string `json:"breakfast,omitempty" xml:"breakfast,omitempty"`
// 最晚入住时间
CanCheckinEnd string `json:"can_checkin_end,omitempty" xml:"can_checkin_end,omitempty"`
// 最早入住时间
CanCheckinStart string `json:"can_checkin_start,omitempty" xml:"can_checkin_start,omitempty"`
// 退订政策描述,默认是短文案;
CancelPolicyDesc string `json:"cancel_policy_desc,omitempty" xml:"cancel_policy_desc,omitempty"`
// 退订政策长文案
CancelPolicyDescLong string `json:"cancel_policy_desc_long,omitempty" xml:"cancel_policy_desc_long,omitempty"`
// 退订政策中文案
CancelPolicyDescMiddle string `json:"cancel_policy_desc_middle,omitempty" xml:"cancel_policy_desc_middle,omitempty"`
// 担保开始时间
GuaranteeStartTime string `json:"guarantee_start_time,omitempty" xml:"guarantee_start_time,omitempty"`
// h5下单页链接
H5BuyUrl string `json:"h5_buy_url,omitempty" xml:"h5_buy_url,omitempty"`
// 最长可入住时间标识,float类型
Hourage string `json:"hourage,omitempty" xml:"hourage,omitempty"`
// 库存价格信息
InventoryPrice string `json:"inventory_price,omitempty" xml:"inventory_price,omitempty"`
// 会员等级名称
MemberLevelName string `json:"member_level_name,omitempty" xml:"member_level_name,omitempty"`
// pc购买地址
PcBuyUrl string `json:"pc_buy_url,omitempty" xml:"pc_buy_url,omitempty"`
// 价格政策名称
RatePlanName string `json:"rate_plan_name,omitempty" xml:"rate_plan_name,omitempty"`
// 最晚离店时间,HH:MM格式
CanCheckOutEnd string `json:"can_check_out_end,omitempty" xml:"can_check_out_end,omitempty"`
// 卖家供应商渠道代号,一个卖家可以有多个供应商,使用代号进行区别
Supplier string `json:"supplier,omitempty" xml:"supplier,omitempty"`
// 餐食类型,0--无早, 1--单早, 2--双早, 3--三早, 4--多早
BreakfastCount int64 `json:"breakfast_count,omitempty" xml:"breakfast_count,omitempty"`
// 退订政策类型枚举,1-不能退, 2-免费退, 3-按规则退
CancelType int64 `json:"cancel_type,omitempty" xml:"cancel_type,omitempty"`
// 担保类型
GuaranteeType int64 `json:"guarantee_type,omitempty" xml:"guarantee_type,omitempty"`
// 会员等级
MemberLevel int64 `json:"member_level,omitempty" xml:"member_level,omitempty"`
// 报价类型
PaymentTypeByte int64 `json:"payment_type_byte,omitempty" xml:"payment_type_byte,omitempty"`
// 报价id
RateId int64 `json:"rate_id,omitempty" xml:"rate_id,omitempty"`
// 价格政策id
RpId int64 `json:"rp_id,omitempty" xml:"rp_id,omitempty"`
// 立减金额; 最新接口数据已包含UMP优惠信息,用于信用住场景的优惠返回;
Subtract int64 `json:"subtract,omitempty" xml:"subtract,omitempty"`
// 当前报价对应的rid
Rid int64 `json:"rid,omitempty" xml:"rid,omitempty"`
// 当前报价所属卖家id
SellerId int64 `json:"seller_id,omitempty" xml:"seller_id,omitempty"`
// 当前报价对应的srid
Srid int64 `json:"srid,omitempty" xml:"srid,omitempty"`
// 是否立即确认
InstantConfirm bool `json:"instant_confirm,omitempty" xml:"instant_confirm,omitempty"`
// 注册状态,true-已注册,false-未注册
RegisterStatus bool `json:"register_status,omitempty" xml:"register_status,omitempty"`
// 是否消失方,true--是,空或false-不是
HourRate bool `json:"hour_rate,omitempty" xml:"hour_rate,omitempty"`
// 是否展示”信用住“标签,true--展示,false
LaterPay bool `json:"later_pay,omitempty" xml:"later_pay,omitempty"`
// 是否展示“会员价”标签;不是原价的价格上也有优惠价与会员价的区分;true--展示
MemberPrice bool `json:"member_price,omitempty" xml:"member_price,omitempty"`
}
var poolRate = sync.Pool{
New: func() any {
return new(Rate)
},
}
// GetRate() 从对象池中获取Rate
func GetRate() *Rate {
return poolRate.Get().(*Rate)
}
// ReleaseRate 释放Rate
func ReleaseRate(v *Rate) {
v.Breakfast = ""
v.CanCheckinEnd = ""
v.CanCheckinStart = ""
v.CancelPolicyDesc = ""
v.CancelPolicyDescLong = ""
v.CancelPolicyDescMiddle = ""
v.GuaranteeStartTime = ""
v.H5BuyUrl = ""
v.Hourage = ""
v.InventoryPrice = ""
v.MemberLevelName = ""
v.PcBuyUrl = ""
v.RatePlanName = ""
v.CanCheckOutEnd = ""
v.Supplier = ""
v.BreakfastCount = 0
v.CancelType = 0
v.GuaranteeType = 0
v.MemberLevel = 0
v.PaymentTypeByte = 0
v.RateId = 0
v.RpId = 0
v.Subtract = 0
v.Rid = 0
v.SellerId = 0
v.Srid = 0
v.InstantConfirm = false
v.RegisterStatus = false
v.HourRate = false
v.LaterPay = false
v.MemberPrice = false
poolRate.Put(v)
}