
1package main
2
3import (
4 "bytes"
5 "demo/wxpay_utility"
6 "encoding/json"
7 "fmt"
8 "net/http"
9 "net/url"
10 "time"
11)
12
13func main() {
14
15 config, err := wxpay_utility.CreateMchConfig(
16 "19xxxxxxxx",
17 "1DDE55AD98Exxxxxxxxxx",
18 "/path/to/apiclient_key.pem",
19 "PUB_KEY_ID_xxxxxxxxxxxxx",
20 "/path/to/wxp_pub.pem",
21 )
22 if err != nil {
23 fmt.Println(err)
24 return
25 }
26
27 request := &CreateProductCouponRequest{
28 OutRequestNo: wxpay_utility.String("12345_20250101_A3489"),
29 Scope: PRODUCTCOUPONSCOPE_ALL.Ptr(),
30 Type: PRODUCTCOUPONTYPE_DISCOUNT.Ptr(),
31 UsageMode: USAGEMODE_PROGRESSIVE_BUNDLE.Ptr(),
32
33 ProgressiveBundleUsageInfo: &ProgressiveBundleUsageInfo{
34 Count: wxpay_utility.Int64(3),
35 IntervalDays: wxpay_utility.Int64(1),
36 },
37
38 DisplayInfo: &ProductCouponDisplayInfo{
39 Name: wxpay_utility.String("全场多次折扣券"),
40 ImageUrl: wxpay_utility.String("https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"),
41 BackgroundUrl: wxpay_utility.String("https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"),
42 DetailImageUrlList: []string{
43 "https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx",
44 },
45 },
46 OutProductNo: wxpay_utility.String("Product_1234567890"),
47
48 StockBundle: &StockBundleForCreate{
49 Remark: wxpay_utility.String("8月工作日有效批次"),
50 CouponCodeMode: COUPONCODEMODE_UPLOAD.Ptr(),
51 StockSendRule: &StockSendRuleForBundle{
52 MaxCount: wxpay_utility.Int64(10000000),
53 MaxCountPerUser: wxpay_utility.Int64(1),
54 },
55
56 ProgressiveBundleUsageRule: &StockBundleUsageRule{
57 CouponAvailablePeriod: &CouponAvailablePeriod{
58 AvailableBeginTime: wxpay_utility.String("2025-08-01T00:00:00+08:00"),
59 AvailableEndTime: wxpay_utility.String("2025-08-31T23:59:59+08:00"),
60 AvailableDays: wxpay_utility.Int64(30),
61 WeeklyAvailablePeriod: &FixedWeekPeriod{
62 DayList: []WeekEnum{
63 WEEKENUM_MONDAY,
64 WEEKENUM_TUESDAY,
65 WEEKENUM_WEDNESDAY,
66 WEEKENUM_THURSDAY,
67 WEEKENUM_FRIDAY,
68 },
69 },
70 },
71
72 DiscountCouponList: []DiscountCouponUsageRule{
73 {
74 Threshold: wxpay_utility.Int64(10000),
75 PercentOff: wxpay_utility.Int64(50),
76 },
77 {
78 Threshold: wxpay_utility.Int64(10000),
79 PercentOff: wxpay_utility.Int64(20),
80 },
81 {
82 Threshold: wxpay_utility.Int64(10000),
83 PercentOff: wxpay_utility.Int64(30),
84 },
85 },
86 },
87
88 UsageRuleDisplayInfo: &UsageRuleDisplayInfo{
89 CouponUsageMethodList: []CouponUsageMethod{
90 COUPONUSAGEMETHOD_OFFLINE,
91 COUPONUSAGEMETHOD_MINI_PROGRAM,
92 COUPONUSAGEMETHOD_PAYMENT_CODE,
93 },
94 MiniProgramAppid: wxpay_utility.String("wx1234567890"),
95 MiniProgramPath: wxpay_utility.String("/pages/index/product"),
96 UsageDescription: wxpay_utility.String("工作日可用"),
97 CouponAvailableStoreInfo: &CouponAvailableStoreInfo{
98 Description: wxpay_utility.String("所有门店可用,可使用小程序查看门店列表"),
99 MiniProgramAppid: wxpay_utility.String("wx1234567890"),
100 MiniProgramPath: wxpay_utility.String("/pages/index/store-list"),
101 },
102 },
103
104 CouponDisplayInfo: &CouponDisplayInfo{
105 CodeDisplayMode: COUPONCODEDISPLAYMODE_QRCODE.Ptr(),
106 BackgroundColor: wxpay_utility.String("Color010"),
107 EntranceMiniProgram: &EntranceMiniProgram{
108 Appid: wxpay_utility.String("wx1234567890"),
109 Path: wxpay_utility.String("/pages/index/product"),
110 EntranceWording: wxpay_utility.String("欢迎选购"),
111 GuidanceWording: wxpay_utility.String("获取更多优惠"),
112 },
113 EntranceOfficialAccount: &EntranceOfficialAccount{
114 Appid: wxpay_utility.String("wx1234567890"),
115 },
116 EntranceFinder: &EntranceFinder{
117 FinderId: wxpay_utility.String("gh_12345678"),
118 FinderVideoId: wxpay_utility.String("UDFsdf24df34dD456Hdf34"),
119 FinderVideoCoverImageUrl: wxpay_utility.String("https://wxpaylogo.qpic.cn/wxpaylogo/xxxxx/xxx"),
120 },
121 },
122 StoreScope: STOCKSTORESCOPE_NONE.Ptr(),
123 NotifyConfig: &NotifyConfig{
124 NotifyAppid: wxpay_utility.String("wx4fd12345678"),
125 },
126 },
127 BrandId: wxpay_utility.String("120344"),
128 }
129
130 response, err := CreateProductCoupon(config, request)
131 if err != nil {
132 fmt.Printf("请求失败: %+v\n", err)
133
134 return
135 }
136
137
138 fmt.Printf("请求成功: %+v\n", response)
139}
140
141func CreateProductCoupon(config *wxpay_utility.MchConfig, request *CreateProductCouponRequest) (response *CreateProductCouponResponse, err error) {
142 const (
143 host = "https://api.mch.weixin.qq.com"
144 method = "POST"
145 path = "/v3/marketing/partner/product-coupon/product-coupons"
146 )
147
148 reqUrl, err := url.Parse(fmt.Sprintf("%s%s", host, path))
149 if err != nil {
150 return nil, err
151 }
152 reqBody, err := json.Marshal(request)
153 if err != nil {
154 return nil, err
155 }
156 httpRequest, err := http.NewRequest(method, reqUrl.String(), bytes.NewReader(reqBody))
157 if err != nil {
158 return nil, err
159 }
160 httpRequest.Header.Set("Accept", "application/json")
161 httpRequest.Header.Set("Wechatpay-Serial", config.WechatPayPublicKeyId())
162 httpRequest.Header.Set("Content-Type", "application/json")
163 authorization, err := wxpay_utility.BuildAuthorization(config.MchId(), config.CertificateSerialNo(), config.PrivateKey(), method, reqUrl.RequestURI(), reqBody)
164 if err != nil {
165 return nil, err
166 }
167 httpRequest.Header.Set("Authorization", authorization)
168
169 client := &http.Client{}
170 httpResponse, err := client.Do(httpRequest)
171 if err != nil {
172 return nil, err
173 }
174 respBody, err := wxpay_utility.ExtractResponseBody(httpResponse)
175 if err != nil {
176 return nil, err
177 }
178 if httpResponse.StatusCode >= 200 && httpResponse.StatusCode < 300 {
179
180 err = wxpay_utility.ValidateResponse(
181 config.WechatPayPublicKeyId(),
182 config.WechatPayPublicKey(),
183 &httpResponse.Header,
184 respBody,
185 )
186 if err != nil {
187 return nil, err
188 }
189 response := &CreateProductCouponResponse{}
190 if err := json.Unmarshal(respBody, response); err != nil {
191 return nil, err
192 }
193
194 return response, nil
195 } else {
196 return nil, wxpay_utility.NewApiException(
197 httpResponse.StatusCode,
198 httpResponse.Header,
199 respBody,
200 )
201 }
202}
203
204type CreateProductCouponRequest struct {
205 OutRequestNo *string `json:"out_request_no,omitempty"`
206 Scope *ProductCouponScope `json:"scope,omitempty"`
207 Type *ProductCouponType `json:"type,omitempty"`
208 UsageMode *UsageMode `json:"usage_mode,omitempty"`
209 SingleUsageInfo *SingleUsageInfo `json:"single_usage_info,omitempty"`
210 ProgressiveBundleUsageInfo *ProgressiveBundleUsageInfo `json:"progressive_bundle_usage_info,omitempty"`
211 DisplayInfo *ProductCouponDisplayInfo `json:"display_info,omitempty"`
212 OutProductNo *string `json:"out_product_no,omitempty"`
213 Stock *StockForCreate `json:"stock,omitempty"`
214 StockBundle *StockBundleForCreate `json:"stock_bundle,omitempty"`
215 BrandId *string `json:"brand_id,omitempty"`
216}
217
218type CreateProductCouponResponse struct {
219 ProductCouponId *string `json:"product_coupon_id,omitempty"`
220 Scope *ProductCouponScope `json:"scope,omitempty"`
221 Type *ProductCouponType `json:"type,omitempty"`
222 UsageMode *UsageMode `json:"usage_mode,omitempty"`
223 SingleUsageInfo *SingleUsageInfo `json:"single_usage_info,omitempty"`
224 ProgressiveBundleUsageInfo *ProgressiveBundleUsageInfo `json:"progressive_bundle_usage_info,omitempty"`
225 DisplayInfo *ProductCouponDisplayInfo `json:"display_info,omitempty"`
226 OutProductNo *string `json:"out_product_no,omitempty"`
227 State *ProductCouponState `json:"state,omitempty"`
228 Stock *StockEntity `json:"stock,omitempty"`
229 StockBundle *StockBundleEntity `json:"stock_bundle,omitempty"`
230 BrandId *string `json:"brand_id,omitempty"`
231}
232
233type ProductCouponScope string
234
235func (e ProductCouponScope) Ptr() *ProductCouponScope {
236 return &e
237}
238
239const (
240 PRODUCTCOUPONSCOPE_ALL ProductCouponScope = "ALL"
241 PRODUCTCOUPONSCOPE_SINGLE ProductCouponScope = "SINGLE"
242)
243
244type ProductCouponType string
245
246func (e ProductCouponType) Ptr() *ProductCouponType {
247 return &e
248}
249
250const (
251 PRODUCTCOUPONTYPE_NORMAL ProductCouponType = "NORMAL"
252 PRODUCTCOUPONTYPE_DISCOUNT ProductCouponType = "DISCOUNT"
253 PRODUCTCOUPONTYPE_EXCHANGE ProductCouponType = "EXCHANGE"
254)
255
256type UsageMode string
257
258func (e UsageMode) Ptr() *UsageMode {
259 return &e
260}
261
262const (
263 USAGEMODE_SINGLE UsageMode = "SINGLE"
264 USAGEMODE_PROGRESSIVE_BUNDLE UsageMode = "PROGRESSIVE_BUNDLE"
265)
266
267type SingleUsageInfo struct {
268 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
269 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
270}
271
272type ProgressiveBundleUsageInfo struct {
273 Count *int64 `json:"count,omitempty"`
274 IntervalDays *int64 `json:"interval_days,omitempty"`
275}
276
277type ProductCouponDisplayInfo struct {
278 Name *string `json:"name,omitempty"`
279 ImageUrl *string `json:"image_url,omitempty"`
280 BackgroundUrl *string `json:"background_url,omitempty"`
281 DetailImageUrlList []string `json:"detail_image_url_list,omitempty"`
282 OriginalPrice *int64 `json:"original_price,omitempty"`
283 ComboPackageList []ComboPackage `json:"combo_package_list,omitempty"`
284}
285
286type StockForCreate struct {
287 Remark *string `json:"remark,omitempty"`
288 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
289 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
290 SingleUsageRule *SingleUsageRule `json:"single_usage_rule,omitempty"`
291 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
292 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
293 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
294 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
295}
296
297type StockBundleForCreate struct {
298 Remark *string `json:"remark,omitempty"`
299 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
300 StockSendRule *StockSendRuleForBundle `json:"stock_send_rule,omitempty"`
301 ProgressiveBundleUsageRule *StockBundleUsageRule `json:"progressive_bundle_usage_rule,omitempty"`
302 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
303 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
304 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
305 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
306}
307
308type ProductCouponState string
309
310func (e ProductCouponState) Ptr() *ProductCouponState {
311 return &e
312}
313
314const (
315 PRODUCTCOUPONSTATE_AUDITING ProductCouponState = "AUDITING"
316 PRODUCTCOUPONSTATE_EFFECTIVE ProductCouponState = "EFFECTIVE"
317 PRODUCTCOUPONSTATE_DEACTIVATED ProductCouponState = "DEACTIVATED"
318)
319
320type StockEntity struct {
321 ProductCouponId *string `json:"product_coupon_id,omitempty"`
322 StockId *string `json:"stock_id,omitempty"`
323 Remark *string `json:"remark,omitempty"`
324 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
325 CouponCodeCountInfo *CouponCodeCountInfo `json:"coupon_code_count_info,omitempty"`
326 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
327 SingleUsageRule *SingleUsageRule `json:"single_usage_rule,omitempty"`
328 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
329 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
330 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
331 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
332 SentCountInfo *StockSentCountInfo `json:"sent_count_info,omitempty"`
333 State *StockState `json:"state,omitempty"`
334 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
335 DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
336 DeactivateReason *string `json:"deactivate_reason,omitempty"`
337 BrandId *string `json:"brand_id,omitempty"`
338}
339
340type StockBundleEntity struct {
341 StockBundleId *string `json:"stock_bundle_id,omitempty"`
342 StockList []StockEntityInBundle `json:"stock_list,omitempty"`
343}
344
345type NormalCouponUsageRule struct {
346 Threshold *int64 `json:"threshold,omitempty"`
347 DiscountAmount *int64 `json:"discount_amount,omitempty"`
348}
349
350type DiscountCouponUsageRule struct {
351 Threshold *int64 `json:"threshold,omitempty"`
352 PercentOff *int64 `json:"percent_off,omitempty"`
353}
354
355type ComboPackage struct {
356 Name *string `json:"name,omitempty"`
357 PickCount *int64 `json:"pick_count,omitempty"`
358 ChoiceList []ComboPackageChoice `json:"choice_list,omitempty"`
359}
360
361type CouponCodeMode string
362
363func (e CouponCodeMode) Ptr() *CouponCodeMode {
364 return &e
365}
366
367const (
368 COUPONCODEMODE_WECHATPAY CouponCodeMode = "WECHATPAY"
369 COUPONCODEMODE_UPLOAD CouponCodeMode = "UPLOAD"
370 COUPONCODEMODE_API_ASSIGN CouponCodeMode = "API_ASSIGN"
371)
372
373type StockSendRule struct {
374 MaxCount *int64 `json:"max_count,omitempty"`
375 MaxCountPerDay *int64 `json:"max_count_per_day,omitempty"`
376 MaxCountPerUser *int64 `json:"max_count_per_user,omitempty"`
377}
378
379type SingleUsageRule struct {
380 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
381 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
382 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
383 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,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}
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 EntranceFinder *EntranceFinder `json:"entrance_finder,omitempty"`
401}
402
403type NotifyConfig struct {
404 NotifyAppid *string `json:"notify_appid,omitempty"`
405}
406
407type StockStoreScope string
408
409func (e StockStoreScope) Ptr() *StockStoreScope {
410 return &e
411}
412
413const (
414 STOCKSTORESCOPE_NONE StockStoreScope = "NONE"
415 STOCKSTORESCOPE_ALL StockStoreScope = "ALL"
416 STOCKSTORESCOPE_SPECIFIC StockStoreScope = "SPECIFIC"
417)
418
419type StockSendRuleForBundle struct {
420 MaxCount *int64 `json:"max_count,omitempty"`
421 MaxCountPerDay *int64 `json:"max_count_per_day,omitempty"`
422 MaxCountPerUser *int64 `json:"max_count_per_user,omitempty"`
423}
424
425type StockBundleUsageRule struct {
426 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
427 NormalCouponList []NormalCouponUsageRule `json:"normal_coupon_list,omitempty"`
428 DiscountCouponList []DiscountCouponUsageRule `json:"discount_coupon_list,omitempty"`
429 ExchangeCouponList []ExchangeCouponUsageRule `json:"exchange_coupon_list,omitempty"`
430}
431
432type CouponCodeCountInfo struct {
433 TotalCount *int64 `json:"total_count,omitempty"`
434 AvailableCount *int64 `json:"available_count,omitempty"`
435}
436
437type StockSentCountInfo struct {
438 TotalCount *int64 `json:"total_count,omitempty"`
439 TodayCount *int64 `json:"today_count,omitempty"`
440}
441
442type StockState string
443
444func (e StockState) Ptr() *StockState {
445 return &e
446}
447
448const (
449 STOCKSTATE_AUDITING StockState = "AUDITING"
450 STOCKSTATE_SENDING StockState = "SENDING"
451 STOCKSTATE_PAUSED StockState = "PAUSED"
452 STOCKSTATE_STOPPED StockState = "STOPPED"
453 STOCKSTATE_DEACTIVATED StockState = "DEACTIVATED"
454)
455
456type StockEntityInBundle struct {
457 ProductCouponId *string `json:"product_coupon_id,omitempty"`
458 StockId *string `json:"stock_id,omitempty"`
459 Remark *string `json:"remark,omitempty"`
460 CouponCodeMode *CouponCodeMode `json:"coupon_code_mode,omitempty"`
461 CouponCodeCountInfo *CouponCodeCountInfo `json:"coupon_code_count_info,omitempty"`
462 StockSendRule *StockSendRule `json:"stock_send_rule,omitempty"`
463 ProgressiveBundleUsageRule *StockUsageRule `json:"progressive_bundle_usage_rule,omitempty"`
464 StockBundleInfo *StockBundleInfo `json:"stock_bundle_info,omitempty"`
465 UsageRuleDisplayInfo *UsageRuleDisplayInfo `json:"usage_rule_display_info,omitempty"`
466 CouponDisplayInfo *CouponDisplayInfo `json:"coupon_display_info,omitempty"`
467 NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
468 StoreScope *StockStoreScope `json:"store_scope,omitempty"`
469 SentCountInfo *StockSentCountInfo `json:"sent_count_info,omitempty"`
470 State *StockState `json:"state,omitempty"`
471 DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
472 DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
473 DeactivateReason *string `json:"deactivate_reason,omitempty"`
474 BrandId *string `json:"brand_id,omitempty"`
475}
476
477type ComboPackageChoice struct {
478 Name *string `json:"name,omitempty"`
479 Price *int64 `json:"price,omitempty"`
480 Count *int64 `json:"count,omitempty"`
481 ImageUrl *string `json:"image_url,omitempty"`
482 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
483 MiniProgramPath *string `json:"mini_program_path,omitempty"`
484}
485
486type CouponAvailablePeriod struct {
487 AvailableBeginTime *string `json:"available_begin_time,omitempty"`
488 AvailableEndTime *string `json:"available_end_time,omitempty"`
489 AvailableDays *int64 `json:"available_days,omitempty"`
490 WaitDaysAfterReceive *int64 `json:"wait_days_after_receive,omitempty"`
491 WeeklyAvailablePeriod *FixedWeekPeriod `json:"weekly_available_period,omitempty"`
492 IrregularAvailablePeriodList []TimePeriod `json:"irregular_available_period_list,omitempty"`
493}
494
495type ExchangeCouponUsageRule struct {
496 Threshold *int64 `json:"threshold,omitempty"`
497 ExchangePrice *int64 `json:"exchange_price,omitempty"`
498}
499
500type CouponUsageMethod string
501
502func (e CouponUsageMethod) Ptr() *CouponUsageMethod {
503 return &e
504}
505
506const (
507 COUPONUSAGEMETHOD_OFFLINE CouponUsageMethod = "OFFLINE"
508 COUPONUSAGEMETHOD_MINI_PROGRAM CouponUsageMethod = "MINI_PROGRAM"
509 COUPONUSAGEMETHOD_APP CouponUsageMethod = "APP"
510 COUPONUSAGEMETHOD_PAYMENT_CODE CouponUsageMethod = "PAYMENT_CODE"
511)
512
513type CouponAvailableStoreInfo struct {
514 Description *string `json:"description,omitempty"`
515 MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
516 MiniProgramPath *string `json:"mini_program_path,omitempty"`
517}
518
519type CouponCodeDisplayMode string
520
521func (e CouponCodeDisplayMode) Ptr() *CouponCodeDisplayMode {
522 return &e
523}
524
525const (
526 COUPONCODEDISPLAYMODE_INVISIBLE CouponCodeDisplayMode = "INVISIBLE"
527 COUPONCODEDISPLAYMODE_BARCODE CouponCodeDisplayMode = "BARCODE"
528 COUPONCODEDISPLAYMODE_QRCODE CouponCodeDisplayMode = "QRCODE"
529)
530
531type EntranceMiniProgram struct {
532 Appid *string `json:"appid,omitempty"`
533 Path *string `json:"path,omitempty"`
534 EntranceWording *string `json:"entrance_wording,omitempty"`
535 GuidanceWording *string `json:"guidance_wording,omitempty"`
536}
537
538type EntranceOfficialAccount struct {
539 Appid *string `json:"appid,omitempty"`
540}
541
542type EntranceFinder struct {
543 FinderId *string `json:"finder_id,omitempty"`
544 FinderVideoId *string `json:"finder_video_id,omitempty"`
545 FinderVideoCoverImageUrl *string `json:"finder_video_cover_image_url,omitempty"`
546}
547
548type StockUsageRule struct {
549 CouponAvailablePeriod *CouponAvailablePeriod `json:"coupon_available_period,omitempty"`
550 NormalCoupon *NormalCouponUsageRule `json:"normal_coupon,omitempty"`
551 DiscountCoupon *DiscountCouponUsageRule `json:"discount_coupon,omitempty"`
552 ExchangeCoupon *ExchangeCouponUsageRule `json:"exchange_coupon,omitempty"`
553}
554
555type StockBundleInfo struct {
556 StockBundleId *string `json:"stock_bundle_id,omitempty"`
557 StockBundleIndex *int64 `json:"stock_bundle_index,omitempty"`
558}
559
560type FixedWeekPeriod struct {
561 DayList []WeekEnum `json:"day_list,omitempty"`
562 DayPeriodList []PeriodOfTheDay `json:"day_period_list,omitempty"`
563}
564
565type TimePeriod struct {
566 BeginTime *string `json:"begin_time,omitempty"`
567 EndTime *string `json:"end_time,omitempty"`
568}
569
570type WeekEnum string
571
572func (e WeekEnum) Ptr() *WeekEnum {
573 return &e
574}
575
576const (
577 WEEKENUM_MONDAY WeekEnum = "MONDAY"
578 WEEKENUM_TUESDAY WeekEnum = "TUESDAY"
579 WEEKENUM_WEDNESDAY WeekEnum = "WEDNESDAY"
580 WEEKENUM_THURSDAY WeekEnum = "THURSDAY"
581 WEEKENUM_FRIDAY WeekEnum = "FRIDAY"
582 WEEKENUM_SATURDAY WeekEnum = "SATURDAY"
583 WEEKENUM_SUNDAY WeekEnum = "SUNDAY"
584)
585
586type PeriodOfTheDay struct {
587 BeginTime *int64 `json:"begin_time,omitempty"`
588 EndTime *int64 `json:"end_time,omitempty"`
589}
590