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