-
Notifications
You must be signed in to change notification settings - Fork 2
/
rates_estimate_model.go
178 lines (172 loc) · 5.97 KB
/
rates_estimate_model.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
package model_public
// weight: 0.25,
// domain: multiaccesoris, -> shop domain
// productId: 2248059401,
// origin: 5637|15810|YHeWJestVbuD66PoGVDnlQaHYJAZ8CG10NtXqKCEcuLjE3IncRxwVBiPSs6Tw6PTDkzUsF9kBXgJqw%3D%3D, -> geolocation PDPGetDataP2
// destination: 2935||-8.127172,112.417213,
// POTime: 0,
// isFulfillment: false,
// deviceType: default_v3,
// shopTier: 3,
// bo_metadata: "",
// free_shipping_flag: 0,
// warehouse_id: 113930
type RatesEstimateQueryVar struct {
Weight float64 `json:"weight"`
Domain string `json:"domain"`
ProductID string `json:"productId"`
Origin string `json:"origin"`
Destination string `json:"destination"`
POTime int `json:"POTime"`
IsFulfillment bool `json:"isFulfillment"`
DeviceType string `json:"deviceType"`
ShopTier int `json:"shopTier"`
BoMetadata string `json:"bo_metadata"`
FreeShippingFlag int `json:"free_shipping_flag"`
WarehouseID string `json:"warehouse_id"`
}
//////////////////////////////////////////////
type Address struct {
CityName string `json:"city_name"`
ProvinceName string `json:"province_name"`
DistrictName string `json:"district_name"`
Country string `json:"country"`
PostalCode string `json:"postal_code"`
Address string `json:"address"`
Lat string `json:"lat"`
Long string `json:"long"`
Phone string `json:"phone"`
AddrName string `json:"addr_name"`
Address1 string `json:"address_1"`
ReceiverName string `json:"receiver_name"`
Typename string `json:"__typename"`
}
type RatesService struct {
ServiceName string `json:"service_name"`
ServiceID int `json:"service_id"`
ServiceOrder int `json:"service_order"`
Status int `json:"status"`
RangePrice struct {
MinPrice int `json:"min_price"`
MaxPrice int `json:"max_price"`
Typename string `json:"__typename"`
} `json:"range_price"`
Texts struct {
TextServiceDesc string `json:"text_service_desc"`
TextServiceNotes string `json:"text_service_notes"`
TextRangePrice string `json:"text_range_price"`
TextEtd string `json:"text_etd"`
TextPrice string `json:"text_price"`
Typename string `json:"__typename"`
} `json:"texts"`
Products []struct {
ShipperName string `json:"shipper_name"`
ShipperID int `json:"shipper_id"`
ShipperProductID int `json:"shipper_product_id"`
ShipperProductName string `json:"shipper_product_name"`
ShipperWeight int `json:"shipper_weight"`
Price struct {
Price int `json:"price"`
FormattedPrice string `json:"formatted_price"`
Typename string `json:"__typename"`
} `json:"price"`
Texts struct {
TextEtd string `json:"text_etd"`
TextRangePrice string `json:"text_range_price"`
TextEtaSummarize string `json:"text_eta_summarize"`
Typename string `json:"__typename"`
} `json:"texts"`
Cod struct {
IsCodAvailable int `json:"is_cod_available"`
Typename string `json:"__typename"`
} `json:"cod"`
Eta struct {
TextEta string `json:"text_eta"`
ErrorCode int `json:"error_code"`
Typename string `json:"__typename"`
} `json:"eta"`
Features struct {
DynamicPrice struct {
TextLabel string `json:"text_label"`
Typename string `json:"__typename"`
} `json:"dynamic_price"`
Typename string `json:"__typename"`
} `json:"features"`
Typename string `json:"__typename"`
} `json:"products"`
ServiceBasedShipment struct {
IsAvailable bool `json:"is_available"`
TextPrice string `json:"text_price"`
TextEta string `json:"text_eta"`
Typename string `json:"__typename"`
} `json:"service_based_shipment"`
Cod struct {
IsCod int `json:"is_cod"`
CodText string `json:"cod_text"`
Typename string `json:"__typename"`
} `json:"cod"`
OrderPriority struct {
IsNow bool `json:"is_now"`
Typename string `json:"__typename"`
} `json:"order_priority"`
Etd struct {
MinEtd int `json:"min_etd"`
MaxEtd int `json:"max_etd"`
Typename string `json:"__typename"`
} `json:"etd"`
Typename string `json:"__typename"`
}
type RatesEstimateV3 struct {
Data struct {
Address Address `json:"address"`
Shop struct {
DistrictID int `json:"district_id"`
DistrictName string `json:"district_name"`
PostalCode string `json:"postal_code"`
Origin int `json:"origin"`
AddrStreet string `json:"addr_street"`
Latitude string `json:"latitude"`
Longitude string `json:"longitude"`
ProvinceID int `json:"province_id"`
CityID int `json:"city_id"`
CityName string `json:"city_name"`
Typename string `json:"__typename"`
} `json:"shop"`
Rates struct {
ID string `json:"id"`
RatesID string `json:"rates_id"`
Type string `json:"type"`
Services []RatesService `json:"services"`
Typename string `json:"__typename"`
} `json:"rates"`
Texts struct {
TextMinPrice string `json:"text_min_price"`
TextDestination string `json:"text_destination"`
TextEta string `json:"text_eta"`
Typename string `json:"__typename"`
} `json:"texts"`
FreeShipping struct {
Flag int `json:"flag"`
ShippingPrice string `json:"shipping_price"`
EtaText string `json:"eta_text"`
ErrorCode int `json:"error_code"`
IconURL string `json:"icon_url"`
Title string `json:"title"`
Typename string `json:"__typename"`
} `json:"free_shipping"`
TokocabangFrom struct {
Title string `json:"title"`
Content string `json:"content"`
IconURL string `json:"icon_url"`
Typename string `json:"__typename"`
} `json:"tokocabang_from"`
IsBlackbox bool `json:"is_blackbox"`
Typename string `json:"__typename"`
} `json:"data"`
Typename string `json:"__typename"`
}
type RatesEstimateQueryResp []struct {
Data struct {
RatesEstimateV3 RatesEstimateV3 `json:"ratesEstimateV3"`
} `json:"data"`
}