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