1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package ikc
import (
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
)
type activityIkc struct {
}
//Activity 活动
var Activity = activityIkc{}
type ActivityListReq struct {
ActiveModel int `json:"activeModel,omitempty"`
CategoryId string `json:"categoryId,omitempty"`
ActiveIds []string `json:"activeIds,omitempty"`
PageNo int `json:"pageNo"`
PageSize int `json:"pageSize"`
}
type ActivityListRes struct {
ResultCode int `json:"resultCode"`
ResultMessage string `json:"resultMessage"`
Total int `json:"total"`
Data []struct {
Activity struct {
Id string `json:"id"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Name string `json:"name"`
Description string `json:"description"`
Banner []string `json:"banner"`
Brand string `json:"brand"`
BrandLogoUrl string `json:"brandLogoUrl"`
StatementByDay string `json:"statementByDay"`
CategoryId string `json:"categoryId"`
Category string `json:"category"`
DeliverTime string `json:"deliverTime"`
Content string `json:"content"`
ActiveModel int `json:"activeModel"`
AftersaleEndTime string `json:"aftersaleEndTime"`
PreviewInformation string `json:"previewInformation"`
RefundInsurance bool `json:"refundInsurance"`
IsExchangeRefundGoods int `json:"isExchangeRefundGoods"`
ActiveType int `json:"activeType"`
Status int `json:"status"`
} `json:"activity"`
} `json:"data"`
}
//List 列表
func (*activityIkc) List(ctx context.Context, req ActivityListReq) (res *ActivityListRes, err error) {
method := "activity/v2/list/filter"
result, err := post(ctx, method, req)
_ = gjson.New(result).Scan(&res)
return
}
type ActivityDetailRes struct {
ResultCode int `json:"resultCode"`
ResultMessage string `json:"resultMessage"`
Data struct {
Activity struct {
Id string `json:"id"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Name string `json:"name"`
Description string `json:"description"`
Banner []string `json:"banner"`
Brand string `json:"brand"`
BrandLogoUrl string `json:"brandLogoUrl"`
StatementByDay string `json:"statementByDay"`
CategoryId string `json:"categoryId"`
Category string `json:"category"`
DeliverTime string `json:"deliverTime"`
Content string `json:"content"`
ActiveModel int `json:"activeModel"`
AftersaleEndTime string `json:"aftersaleEndTime"`
PreviewInformation string `json:"previewInformation"`
RefundInsurance bool `json:"refundInsurance"`
IsExchangeRefundGoods int `json:"isExchangeRefundGoods"`
ActiveType int `json:"activeType"`
WaterMarkLicense string `json:"waterMarkLicense"`
IsSuppotVatInvoice int `json:"isSuppotVatInvoice"`
Status int `json:"status"`
} `json:"activity"`
} `json:"data"`
}
//Detail 详情
func (*activityIkc) Detail(ctx context.Context, req string) (res *ActivityDetailRes, err error) {
method := "activity/detail"
result, err := post(ctx, method, g.Map{
"liveId": req,
})
_ = gjson.New(result).Scan(&res)
return
}