
1package main
2
3import (
4 "bytes"
5 "demo/wxpay_brand_utility"
6 "encoding/json"
7 "fmt"
8 "net/http"
9 "net/url"
10 "strings"
11 "time"
12)
13
14func main() {
15
16 config, err := wxpay_brand_utility.CreateBrandConfig(
17 "xxxxxxxx",
18 "1DDE55AD98Exxxxxxxxxx",
19 "/path/to/apiclient_key.pem",
20 "PUB_KEY_ID_xxxxxxxxxxxxx",
21 "/path/to/wxp_pub.pem",
22 )
23 if err != nil {
24 fmt.Println(err)
25 return
26 }
27
28 request := &ConfirmSendUserProductCouponRequest{
29 ProductCouponId: wxpay_brand_utility.String("1000000013"),
30 StockId: wxpay_brand_utility.String("1000000013001"),
31 CouponCode: wxpay_brand_utility.String("Code_123456"),
32 Appid: wxpay_brand_utility.String("wx233544546545989"),
33 Openid: wxpay_brand_utility.String("oh-394z-6CGkNoJrsDLTTUKiAnp4"),
34 OutRequestNo: wxpay_brand_utility.String("MCHCONFIRM202003101234"),
35 }
36
37 response, err := ConfirmSendUserProductCoupon(config, request)
38 if err != nil {
39 fmt.Printf("请求失败: %+v\n", err)
40
41 return
42 }
43
44
45 fmt.Printf("请求成功: %+v\n", response)
46}
47
48func ConfirmSendUserProductCoupon(config *wxpay_brand_utility.BrandConfig, request *ConfirmSendUserProductCouponRequest) (response *UserProductCouponEntity, err error) {
49 const (
50 host = "https://api.mch.weixin.qq.com"
51 method = "POST"
52 path = "/brand/marketing/product-coupon/users/{openid}/coupons/{coupon_code}/confirm"
53 )
54
55 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path))
56 if err != nil {
57 return nil, err
58 }
59 reqUrl.Path = strings.Replace(reqUrl.Path, "{coupon_code}", url.PathEscape(*request.CouponCode), -1)
60 reqUrl.Path = strings.Replace(reqUrl.Path, "{openid}", url.PathEscape(*request.Openid), -1)
61 reqBody, err := json.Marshal(request)
62 if err != nil {
63 return nil, err
64 }
65 httpRequest, err := http.NewRequest(method, reqUrl.String(), bytes.NewReader(reqBody))
66 if err != nil {
67 return nil, err
68 }
69 httpRequest.Header.Set("Accept", "application/json")
70 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId())
71 httpRequest.Header.Set("Content-Type", "application/json")
72 authorization, err := wxpay_brand_utility.BuildAuthorization(config.BrandId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), reqBody)
73 if err != nil {
74 return nil, err
75 }
76 httpRequest.Header.Set("Authorization", authorization)
77
78 client := &http.Client{}
79 httpResponse, err := client.Do(httpRequest)
80 if err != nil {
81 return nil, err
82 }
83 respBody, err := wxpay_brand_utility.ExtractResponseBody(httpResponse)
84 if err != nil {
85 return nil, err
86 }
87 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 {
88
89 err = wxpay_brand_utility.ValidateResponse(
90 config.WechatPayPublicKeyId(),
91 config.WechatPayPublicKey(),
92 &httpResponse.Header,
93 respBody,
94 )
95 if err != nil {
96 return nil, err
97 }
98 response := &UserProductCouponEntity{}
99 if err := json.Unmarshal(respBody, response); err != nil {
100 return nil, err
101 }
102
103 return response, nil
104 } else {
105 return nil, wxpay_brand_utility.NewApiException(
106 httpResponse.StatusCode,
107 httpResponse.Header,
108 respBody,
109 )
110 }
111}
112
113type ConfirmSendUserProductCouponRequest struct {
114 ProductCouponId *string `json:"product_coupon_id,omitempty"`
115 StockId *string `json:"stock_id,omitempty"`
116 CouponCode *string `json:"coupon_code,omitempty"`
117 Appid *string `json:"appid,omitempty"`
118 Openid *string `json:"openid,omitempty"`
119 OutRequestNo *string `json:"out_request_no,omitempty"`
120}
121
122func (o *ConfirmSendUserProductCouponRequest) MarshalJSON() ([]byte, error) {
123 type Alias ConfirmSendUserProductCouponRequest
124 a := &struct {
125 CouponCode *string `json:"coupon_code,omitempty"`
126 Openid *string `json:"openid,omitempty"`
127 *Alias
128 }{
129
130 CouponCode: nil,
131 Openid: nil,
132 Alias: (*Alias)(o),
133 }
134 return json.Marshal(a)
135}
136
137type UserProductCouponEntity struct {
138 CouponCode *string `json:"coupon_code,omitempty"`
139 CouponState *UserProductCouponState `json:"coupon_state,omitempty"`
140 ValidBeginTime *time.Time `json:"valid_begin_time,omitempty"`
141 ValidEndTime *time.Time `json:"valid_end_time,omitempty"`
142 ReceiveTime *string `json:"receive_time,omitempty"`
143 SendRequestNo *string `json:"send_request_no,omitempty"`
144 SendChannel *UserProductCouponSendChannel `json:"send_channel,omitempty"`
145 ConfirmRequestNo *string `json:"confirm_request_no,omitempty"`
146 ConfirmTime *time.Time `json:"confirm_time,omitempty"`
147 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
148 DeactivateTime *string `json:"deactivate_time,omitempty"`
149 DeactivateReason *string `json:"deactivate_reason,omitempty"`
150 SingleUsageDetail *CouponUsageDetail `json:"single_usage_detail,omitempty"`
151 ProgressiveBundleUsageDetail *CouponUsageDetail `json:"progressive_bundle_usage_detail,omitempty"`
152 UserProductCouponBundleInfo *UserProductCouponBundleInfo `json:"user_product_coupon_bundle_info,omitempty"`
153 ProductCoupon *ProductCouponEntity `json:"product_coupon,omitempty"`
154 Stock *StockEntity `json:"stock,omitempty"`
155 Attach *string `json:"attach,omitempty"`
156 ChannelCustomInfo *string `json:"channel_custom_info,omitempty"`
157 CouponTagInfo *CouponTagInfo `json:"coupon_tag_info,omitempty"`
158}
159
160type UserProductCouponState string
161
162func (e UserProductCouponState) Ptr() *UserProductCouponState {
163 return &e
164}
165
166const (
167 USERPRODUCTCOUPONSTATE_CONFIRMING UserProductCouponState = "CONFIRMING"
168 USERPRODUCTCOUPONSTATE_PENDING UserProductCouponState = "PENDING"
169 USERPRODUCTCOUPONSTATE_EFFECTIVE UserProductCouponState = "EFFECTIVE"
170 USERPRODUCTCOUPONSTATE_USED UserProductCouponState = "USED"
171 USERPRODUCTCOUPONSTATE_EXPIRED UserProductCouponState = "EXPIRED"
172 USERPRODUCTCOUPONSTATE_DELETED UserProductCouponState = "DELETED"
173 USERPRODUCTCOUPONSTATE_DEACTIVATED UserProductCouponState = "DEACTIVATED"
174)
175
176type UserProductCouponSendChannel string
177
178func (e UserProductCouponSendChannel) Ptr() *UserProductCouponSendChannel {
179 return &e
180}
181
182const (
183 USERPRODUCTCOUPONSENDCHANNEL_BRAND_MANAGE UserProductCouponSendChannel = "BRAND_MANAGE"
184 USERPRODUCTCOUPONSENDCHANNEL_API UserProductCouponSendChannel = "API"
185 USERPRODUCTCOUPONSENDCHANNEL_RECEIVE_COMPONENT UserProductCouponSendChannel = "RECEIVE_COMPONENT"
186 USERPRODUCTCOUPONSENDCHANNEL_MEMBER UserProductCouponSendChannel = "MEMBER"
187 USERPRODUCTCOUPONSENDCHANNEL_STICKER_GIFT UserProductCouponSendChannel = "STICKER_GIFT"
188)
189
190type CouponUsageDetail struct {
191 UseRequestNo *string `json:"use_request_no,omitempty"`
192 UseTime *time.Time `json:"use_time,omitempty"`
193 ReturnRequestNo *string `json:"return_request_no,omitempty"`
194 ReturnTime *time.Time `json:"return_time,omitempty"`
195 AssociatedOrderInfo *UserProductCouponAssociatedOrderInfo `json:"associated_order_info,omitempty"`
196 AssociatedPayScoreOrderInfo *UserProductCouponAssociatedPayScoreOrderInfo `json:"associated_pay_score_order_info,omitempty"`
197 SavedAmount *int64 `json:"saved_amount,omitempty"`
198 UseProductNoList []string `json:"use_product_no_list,omitempty"`
199}
200
201type UserProductCouponBundleInfo struct {
202 UserCouponBundleId *string `json:"user_coupon_bundle_id,omitempty"`
203 UserCouponBundleIndex *int64 `json:"user_coupon_bundle_index,omitempty"`
204 TotalCount *int64 `json:"total_count,omitempty"`
205 UsedCount *int64 `json:"used_count,omitempty"`
206}
207
208type ProductCouponEntity struct {
209 ProductCouponId *string `json:"product_coupon_id,omitempty"`
210 Scope *ProductCouponScope `json:"scope,omitempty"`
211 Type *ProductCouponType `json:"type,omitempty"`
212 UsageMode *UsageMode `json:"usage_mode,omitempty"`
213 SingleUsageInfo *SingleUsageInfo `json:"single_usage_info,omitempty"`
214 ProgressiveBundleUsageInfo *ProgressiveBundleUsageInfo `json:"progressive_bundle_usage_info,omitempty"`
215 DisplayInfo *ProductCouponDisplayInfo `json:"display_info,omitempty"`
216 OutProductNo *string `json:"out_product_no,omitempty"`
217 State *ProductCouponState `json:"state,omitempty"`
218 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
219 DeactivateTime *string `json:"deactivate_time,omitempty"`
220 DeactivateReason *string `json:"deactivate_reason,omitempty"`
221 ShowAsExchange *bool `json:"show_as_exchange,omitempty"`
222 AvailableProductNoList []string `json:"available_product_no_list,omitempty"`
223 BusinessMode *ProductCouponBusinessMode `json:"business_mode,omitempty"`
224}
225
226type StockEntity struct {
227 ProductCouponId *string `json:"product_coupon_id,omitempty"`
228 StockId *string `json:"stock_id,omitempty"`
229 Remark *string `json:"remark,omitempty"`
230 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
231 CouponCodeCountInfo *CouponCodeCountInfo `json:"coupon_code_count_info,omitempty"`
232 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
233 SingleUsageRule *SingleUsageRule `json:"single_usage_rule,omitempty"`
234 ProgressiveBundleUsageRule *StockUsageRule `json:"progressive_bundle_usage_rule,omitempty"`
235 StockBundleInfo *StockBundleInfo `json:"stock_bundle_info,omitempty"`
236 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
237 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
238 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
239 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
240 SentCountInfo *StockSentCountInfo `json:"sent_count_info,omitempty"`
241 State *StockState `json:"state,omitempty"`
242 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
243 DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
244 DeactivateReason *string `json:"deactivate_reason,omitempty"`
245}
246
247type CouponTagInfo struct {
248 CouponTagList []UserProductCouponTag `json:"coupon_tag_list,omitempty"`
249 MemberTagInfo *MemberTagInfo `json:"member_tag_info,omitempty"`
250}
251
252type UserProductCouponAssociatedOrderInfo struct {
253 TransactionId *string `json:"transaction_id,omitempty"`
254 OutTradeNo *string `json:"out_trade_no,omitempty"`
255 Mchid *string `json:"mchid,omitempty"`
256 SubMchid *string `json:"sub_mchid,omitempty"`
257}
258
259type UserProductCouponAssociatedPayScoreOrderInfo struct {
260 OrderId *string `json:"order_id,omitempty"`
261 OutOrderNo *string `json:"out_order_no,omitempty"`
262 Mchid *string `json:"mchid,omitempty"`
263 SubMchid *string `json:"sub_mchid,omitempty"`
264}
265
266type ProductCouponScope string
267
268func (e ProductCouponScope) Ptr() *ProductCouponScope {
269 return &e
270}
271
272const (
273 PRODUCTCOUPONSCOPE_ALL ProductCouponScope = "ALL"
274 PRODUCTCOUPONSCOPE_SINGLE ProductCouponScope = "SINGLE"
275 PRODUCTCOUPONSCOPE_CATEGORY ProductCouponScope = "CATEGORY"
276)
277
278type ProductCouponType string
279
280func (e ProductCouponType) Ptr() *ProductCouponType {
281 return &e
282}
283
284const (
285 PRODUCTCOUPONTYPE_NORMAL ProductCouponType = "NORMAL"
286 PRODUCTCOUPONTYPE_DISCOUNT ProductCouponType = "DISCOUNT"
287 PRODUCTCOUPONTYPE_EXCHANGE ProductCouponType = "EXCHANGE"
288)
289
290type UsageMode string
291
292func (e UsageMode) Ptr() *UsageMode {
293 return &e
294}
295
296const (
297 USAGEMODE_SINGLE UsageMode = "SINGLE"
298 USAGEMODE_PROGRESSIVE_BUNDLE UsageMode = "PROGRESSIVE_BUNDLE"
299)
300
301type SingleUsageInfo struct {
302 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
303 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
304}
305
306type ProgressiveBundleUsageInfo struct {
307 Count *int64 `json:"count,omitempty"`
308 IntervalDays *int64 `json:"interval_days,omitempty"`
309}
310
311type ProductCouponDisplayInfo struct {
312 Name *string `json:"name,omitempty"`
313 ImageUrl *string `json:"image_url,omitempty"`
314 BackgroundUrl *string `json:"background_url,omitempty"`
315 DetailImageUrlList []string `json:"detail_image_url_list,omitempty"`
316 OriginalPrice *int64 `json:"original_price,omitempty"`
317 ComboPackageList []ComboPackage `json:"combo_package_list,omitempty"`
318}
319
320type ProductCouponState string
321
322func (e ProductCouponState) Ptr() *ProductCouponState {
323 return &e
324}
325
326const (
327 PRODUCTCOUPONSTATE_AUDITING ProductCouponState = "AUDITING"
328 PRODUCTCOUPONSTATE_EFFECTIVE ProductCouponState = "EFFECTIVE"
329 PRODUCTCOUPONSTATE_DEACTIVATED ProductCouponState = "DEACTIVATED"
330)
331
332type ProductCouponBusinessMode string
333
334func (e ProductCouponBusinessMode) Ptr() *ProductCouponBusinessMode {
335 return &e
336}
337
338const (
339 PRODUCTCOUPONBUSINESSMODE_FREE ProductCouponBusinessMode = "FREE"
340)
341
342type CouponCodeMode string
343
344func (e CouponCodeMode) Ptr() *CouponCodeMode {
345 return &e
346}
347
348const (
349 COUPONCODEMODE_WECHATPAY CouponCodeMode = "WECHATPAY"
350 COUPONCODEMODE_UPLOAD CouponCodeMode = "UPLOAD"
351 COUPONCODEMODE_API_ASSIGN CouponCodeMode = "API_ASSIGN"
352)
353
354type CouponCodeCountInfo struct {
355 TotalCount *int64 `json:"total_count,omitempty"`
356 AvailableCount *int64 `json:"available_count,omitempty"`
357}
358
359type StockSendRule struct {
360 MaxCount *int64 `json:"max_count,omitempty"`
361 MaxCountPerDay *int64 `json:"max_count_per_day,omitempty"`
362 MaxCountPerUser *int64 `json:"max_count_per_user,omitempty"`
363}
364
365type SingleUsageRule struct {
366 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
367 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
368 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
369 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"`
370}
371
372type StockUsageRule struct {
373 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
374 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
375 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
376 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"`
377}
378
379type StockBundleInfo struct {
380 StockBundleId *string `json:"stock_bundle_id,omitempty"`
381 StockBundleIndex *int64 `json:"stock_bundle_index,omitempty"`
382}
383
384type UsageRuleDisplayInfo struct {
385 CouponUsageMethodList []CouponUsageMethod `json:"coupon_usage_method_list,omitempty"`
386 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
387 MiniProgramPath *string `json:"mini_program_path,omitempty"`
388 AppPath *string `json:"app_path,omitempty"`
389 UsageDescription *string `json:"usage_description,omitempty"`
390 CouponAvailableStoreInfo *CouponAvailableStoreInfo `json:"coupon_available_store_info,omitempty"`
391 AppJumpType *AppJumpType `json:"app_jump_type,omitempty"`
392 PasscodeLink *string `json:"passcode_link,omitempty"`
393}
394
395type CouponDisplayInfo struct {
396 CodeDisplayMode *CouponCodeDisplayMode `json:"code_display_mode,omitempty"`
397 BackgroundColor *string `json:"background_color,omitempty"`
398 EntranceMiniProgram *EntranceMiniProgram `json:"entrance_mini_program,omitempty"`
399 EntranceOfficialAccount *EntranceOfficialAccount `json:"entrance_official_account,omitempty"`
400}
401
402type NotifyConfig struct {
403 NotifyAppid *string `json:"notify_appid,omitempty"`
404}
405
406type StockStoreScope string
407
408func (e StockStoreScope) Ptr() *StockStoreScope {
409 return &e
410}
411
412const (
413 STOCKSTORESCOPE_NONE StockStoreScope = "NONE"
414 STOCKSTORESCOPE_ALL StockStoreScope = "ALL"
415 STOCKSTORESCOPE_SPECIFIC StockStoreScope = "SPECIFIC"
416)
417
418type StockSentCountInfo struct {
419 TotalCount *int64 `json:"total_count,omitempty"`
420 TodayCount *int64 `json:"today_count,omitempty"`
421}
422
423type StockState string
424
425func (e StockState) Ptr() *StockState {
426 return &e
427}
428
429const (
430 STOCKSTATE_AUDITING StockState = "AUDITING"
431 STOCKSTATE_SENDING StockState = "SENDING"
432 STOCKSTATE_PAUSED StockState = "PAUSED"
433 STOCKSTATE_STOPPED StockState = "STOPPED"
434 STOCKSTATE_DEACTIVATED StockState = "DEACTIVATED"
435)
436
437type UserProductCouponTag string
438
439func (e UserProductCouponTag) Ptr() *UserProductCouponTag {
440 return &e
441}
442
443const (
444 USERPRODUCTCOUPONTAG_MEMBER UserProductCouponTag = "MEMBER"
445 USERPRODUCTCOUPONTAG_MEMBER_ACTIVITY UserProductCouponTag = "MEMBER_ACTIVITY"
446)
447
448type MemberTagInfo struct {
449 MemberCardId *string `json:"member_card_id,omitempty"`
450}
451
452type NormalCouponUsageRule struct {
453 Threshold *int64 `json:"threshold,omitempty"`
454 DiscountAmount *int64 `json:"discount_amount,omitempty"`
455}
456
457type DiscountCouponUsageRule struct {
458 Threshold *int64 `json:"threshold,omitempty"`
459 PercentOff *int64 `json:"percent_off,omitempty"`
460}
461
462type ComboPackage struct {
463 Name *string `json:"name,omitempty"`
464 PickCount *int64 `json:"pick_count,omitempty"`
465 ChoiceList []ComboPackageChoice `json:"choice_list,omitempty"`
466}
467
468type CouponAvailablePeriod struct {
469 AvailableBeginTime *string `json:"available_begin_time,omitempty"`
470 AvailableEndTime *string `json:"available_end_time,omitempty"`
471 AvailableDays *int64 `json:"available_days,omitempty"`
472 WaitDaysAfterReceive *int64 `json:"wait_days_after_receive,omitempty"`
473 WeeklyAvailablePeriod *FixedWeekPeriod `json:"weekly_available_period,omitempty"`
474 IrregularAvailablePeriodList []TimePeriod `json:"irregular_available_period_list,omitempty"`
475 AvailableSeconds *int64 `json:"available_seconds,omitempty"`
476}
477
478type ExchangeCouponUsageRule struct {
479 Threshold *int64 `json:"threshold,omitempty"`
480 ExchangePrice *int64 `json:"exchange_price,omitempty"`
481}
482
483type CouponUsageMethod string
484
485func (e CouponUsageMethod) Ptr() *CouponUsageMethod {
486 return &e
487}
488
489const (
490 COUPONUSAGEMETHOD_OFFLINE CouponUsageMethod = "OFFLINE"
491 COUPONUSAGEMETHOD_MINI_PROGRAM CouponUsageMethod = "MINI_PROGRAM"
492 COUPONUSAGEMETHOD_APP CouponUsageMethod = "APP"
493 COUPONUSAGEMETHOD_PAYMENT_CODE CouponUsageMethod = "PAYMENT_CODE"
494)
495
496type CouponAvailableStoreInfo struct {
497 Description *string `json:"description,omitempty"`
498 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
499 MiniProgramPath *string `json:"mini_program_path,omitempty"`
500}
501
502type AppJumpType string
503
504func (e AppJumpType) Ptr() *AppJumpType {
505 return &e
506}
507
508const (
509 APPJUMPTYPE_H5 AppJumpType = "H5"
510 APPJUMPTYPE_PASSCODE_LINK AppJumpType = "PASSCODE_LINK"
511 APPJUMPTYPE_USAGE_GUIDE AppJumpType = "USAGE_GUIDE"
512)
513
514type CouponCodeDisplayMode string
515
516func (e CouponCodeDisplayMode) Ptr() *CouponCodeDisplayMode {
517 return &e
518}
519
520const (
521 COUPONCODEDISPLAYMODE_INVISIBLE CouponCodeDisplayMode = "INVISIBLE"
522 COUPONCODEDISPLAYMODE_BARCODE CouponCodeDisplayMode = "BARCODE"
523 COUPONCODEDISPLAYMODE_QRCODE CouponCodeDisplayMode = "QRCODE"
524)
525
526type EntranceMiniProgram struct {
527 Appid *string `json:"appid,omitempty"`
528 Path *string `json:"path,omitempty"`
529 EntranceWording *string `json:"entrance_wording,omitempty"`
530 GuidanceWording *string `json:"guidance_wording,omitempty"`
531}
532
533type EntranceOfficialAccount struct {
534 Appid *string `json:"appid,omitempty"`
535}
536
537type ComboPackageChoice struct {
538 Name *string `json:"name,omitempty"`
539 Price *int64 `json:"price,omitempty"`
540 Count *int64 `json:"count,omitempty"`
541 ImageUrl *string `json:"image_url,omitempty"`
542 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
543 MiniProgramPath *string `json:"mini_program_path,omitempty"`
544}
545
546type FixedWeekPeriod struct {
547 DayList []WeekEnum `json:"day_list,omitempty"`
548 DayPeriodList []PeriodOfTheDay `json:"day_period_list,omitempty"`
549}
550
551type TimePeriod struct {
552 BeginTime *string `json:"begin_time,omitempty"`
553 EndTime *string `json:"end_time,omitempty"`
554}
555
556type WeekEnum string
557
558func (e WeekEnum) Ptr() *WeekEnum {
559 return &e
560}
561
562const (
563 WEEKENUM_MONDAY WeekEnum = "MONDAY"
564 WEEKENUM_TUESDAY WeekEnum = "TUESDAY"
565 WEEKENUM_WEDNESDAY WeekEnum = "WEDNESDAY"
566 WEEKENUM_THURSDAY WeekEnum = "THURSDAY"
567 WEEKENUM_FRIDAY WeekEnum = "FRIDAY"
568 WEEKENUM_SATURDAY WeekEnum = "SATURDAY"
569 WEEKENUM_SUNDAY WeekEnum = "SUNDAY"
570)
571
572type PeriodOfTheDay struct {
573 BeginTime *int64 `json:"begin_time,omitempty"`
574 EndTime *int64 `json:"end_time,omitempty"`
575}
576