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