-
Notifications
You must be signed in to change notification settings - Fork 3
/
power.go
94 lines (85 loc) · 2.99 KB
/
power.go
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
package wikeyun
type PowerAddCardResult struct {
Code string `json:"code"`
Msg string `json:"msg"`
Time string `json:"time"`
Data struct {
CardNum string `json:"card_num"`
StoreId string `json:"store_id"`
CreateTime int `json:"create_time"`
Type int `json:"type"` // 缴费单位
CmsUid int `json:"cms_uid"`
Province string `json:"province"` // 缴费省份
City string `json:"city"` // 缴费城市
Id string `json:"id"` // 缴费卡编号
} `json:"data"`
}
// PowerAddCard 添加充值卡
func (app *App) PowerAddCard(notMustParams ...Params) (body []byte, err error) {
// 参数
params := app.NewParamsWith(notMustParams...)
// 请求
body, err = app.request("https://router.wikeyun.cn/rest/Power/addCard", params)
return body, err
}
// PowerEditCard 编辑充值卡
func (app *App) PowerEditCard(notMustParams ...Params) (body []byte, err error) {
// 参数
params := app.NewParamsWith(notMustParams...)
// 请求
body, err = app.request("https://router.wikeyun.cn/rest/Power/editCard", params)
return body, err
}
// PowerDelCard 充值卡删除
func (app *App) PowerDelCard(notMustParams ...Params) (body []byte, err error) {
// 参数
params := app.NewParamsWith(notMustParams...)
// 请求
body, err = app.request("https://router.wikeyun.cn/rest/Power/delCard", params)
return body, err
}
// PowerCardInfo 充值卡详情
func (app *App) PowerCardInfo(notMustParams ...Params) (body []byte, err error) {
// 参数
params := app.NewParamsWith(notMustParams...)
// 请求
body, err = app.request("https://router.wikeyun.cn/rest/Power/cardInfo", params)
return body, err
}
type PowerPushOrderResult struct {
Code string `json:"code"`
Msg string `json:"msg"`
Time string `json:"time"`
Data struct {
OrderNumber string `json:"order_number"`
} `json:"data"`
}
// PowerPushOrder 充值下单
func (app *App) PowerPushOrder(notMustParams ...Params) (body []byte, err error) {
// 参数
params := app.NewParamsWith(notMustParams...)
// 请求
body, err = app.request("https://router.wikeyun.cn/rest/Power/pushOrder", params)
return body, err
}
type PowerQueryResult struct {
Code string `json:"code"`
Msg string `json:"msg"`
Time string `json:"time"`
Data struct {
OrderNumber string `json:"order_number"` // 订单号
OrderNo string `json:"order_no"` // 订单号
CardId string `json:"card_id"` // 卡编号
Amount int `json:"amount"` // 充值金额
CostPrice string `json:"cost_price"` // 成本价
Fanli string `json:"fanli"` // 平台返利
Status int `json:"status"` // 交易结果(0 待支付 1 已付充值中 2充值成功 3充值失败需要退款 4退款成功 6 待充值 7 已匹配)
} `json:"data"`
}
func (app *App) PowerQuery(notMustParams ...Params) (body []byte, err error) {
// 参数
params := app.NewParamsWith(notMustParams...)
// 请求
body, err = app.request("https://router.wikeyun.cn/rest/Power/query", params)
return body, err
}