Parcourir la source

change json desc

张延森 il y a 3 ans
Parent
révision
e998760800

+ 3
- 3
authorization/authorizer_token.go Voir le fichier

@@ -31,9 +31,9 @@ type AuthorizerTokenParam struct {
31 31
 // AuthorizerTokenResult 获取/刷新接口调用令牌结果
32 32
 type AuthorizerTokenResult struct {
33 33
 	wxerr.Error
34
-	AuthorizerAccessToken  string  `json:"authorizer_access_token"`
35
-	ExpiresIn              float64 `json:"expires_in"`
36
-	AuthorizerRefreshToken string  `json:"authorizer_refresh_token"`
34
+	AuthorizerAccessToken  string `json:"authorizer_access_token"`
35
+	ExpiresIn              int    `json:"expires_in"`
36
+	AuthorizerRefreshToken string `json:"authorizer_refresh_token"`
37 37
 }
38 38
 
39 39
 const (

+ 2
- 2
authorization/component_token.go Voir le fichier

@@ -30,8 +30,8 @@ type ComponentTokenParam struct {
30 30
 // ComponentTokenResult 获取令牌结果
31 31
 type ComponentTokenResult struct {
32 32
 	wxerr.Error
33
-	ComponentAccessToken string  `json:"component_access_token"`
34
-	ExpiresIn            float64 `json:"expires_in"`
33
+	ComponentAccessToken string `json:"component_access_token"`
34
+	ExpiresIn            int    `json:"expires_in"`
35 35
 }
36 36
 
37 37
 const (

+ 2
- 2
authorization/pre_auth_code.go Voir le fichier

@@ -29,8 +29,8 @@ type PreAuthCodeParam struct {
29 29
 // PreAuthCodeResult 获取预授权码结果
30 30
 type PreAuthCodeResult struct {
31 31
 	wxerr.Error
32
-	PreAuthCode string  `json:"pre_auth_code"`
33
-	ExpiresIn   float64 `json:"expires_in"`
32
+	PreAuthCode string `json:"pre_auth_code"`
33
+	ExpiresIn   int    `json:"expires_in"`
34 34
 }
35 35
 
36 36
 const (

+ 14
- 14
authorization/types.go Voir le fichier

@@ -14,16 +14,16 @@ package authorization
14 14
 
15 15
 // Enum 通用枚举类型
16 16
 type Enum struct {
17
-	ID float64 `json:"id"`
17
+	ID int `json:"id"`
18 18
 }
19 19
 
20 20
 // BusinessInfo 功能的开通状况(0代表未开通,1代表已开通)
21 21
 type BusinessInfo struct {
22
-	OpenStore float64 `json:"open_store"`
23
-	OpenScan  float64 `json:"open_scan"`
24
-	OpenPay   float64 `json:"open_pay"`
25
-	OpenCard  float64 `json:"open_card"`
26
-	OpenShake float64 `json:"open_shake"`
22
+	OpenStore int `json:"open_store"`
23
+	OpenScan  int `json:"open_scan"`
24
+	OpenPay   int `json:"open_pay"`
25
+	OpenCard  int `json:"open_card"`
26
+	OpenShake int `json:"open_shake"`
27 27
 }
28 28
 
29 29
 // FuncInfo 权限
@@ -72,18 +72,18 @@ type AuthorizerInfo struct {
72 72
 type AuthorizationInfo struct {
73 73
 	AuthorizerAppId        string     `json:"authorizer_appid"`
74 74
 	AuthorizerAccessToken  string     `json:"authorizer_access_token"`
75
-	ExpiresIn              float64    `json:"expires_in"`
75
+	ExpiresIn              int        `json:"expires_in"`
76 76
 	AuthorizerRefreshToken string     `json:"authorizer_refresh_token"`
77 77
 	FuncInfo               []FuncInfo `json:"func_info"`
78 78
 }
79 79
 
80 80
 // AuthorizationChangeNotice 授权变更通知
81 81
 type AuthorizationChangeNotice struct {
82
-	AppId                        string  `json:"AppId"`
83
-	CreateTime                   float64 `json:"CreateTime"`
84
-	InfoType                     string  `json:"InfoType"`
85
-	AuthorizerAppid              string  `json:"AuthorizerAppid"`
86
-	AuthorizationCode            string  `json:"AuthorizationCode"`
87
-	AuthorizationCodeExpiredTime float64 `json:"AuthorizationCodeExpiredTime"`
88
-	PreAuthCode                  string  `json:"PreAuthCode"`
82
+	AppId                        string `json:"AppId"`
83
+	CreateTime                   int64  `json:"CreateTime"`
84
+	InfoType                     string `json:"InfoType"`
85
+	AuthorizerAppid              string `json:"AuthorizerAppid"`
86
+	AuthorizationCode            string `json:"AuthorizationCode"`
87
+	AuthorizationCodeExpiredTime int64  `json:"AuthorizationCodeExpiredTime"`
88
+	PreAuthCode                  string `json:"PreAuthCode"`
89 89
 }

+ 4
- 4
authorization/verify_ticket.go Voir le fichier

@@ -20,10 +20,10 @@ import (
20 20
 
21 21
 // ComponentVerifyTicketResult 获取验证票据结果
22 22
 type ComponentVerifyTicketResult struct {
23
-	AppId                 string  `xml:"AppId"`
24
-	CreateTime            float64 `xml:"CreateTime"`
25
-	InfoType              string  `xml:"InfoType"`
26
-	ComponentVerifyTicket string  `xml:"ComponentVerifyTicket"`
23
+	AppId                 string `xml:"AppId"`
24
+	CreateTime            int64  `xml:"CreateTime"`
25
+	InfoType              string `xml:"InfoType"`
26
+	ComponentVerifyTicket string `xml:"ComponentVerifyTicket"`
27 27
 }
28 28
 
29 29
 // ComponentVerifyTicket 获取验证票据

+ 1
- 1
authorizer/authorizer_list.go Voir le fichier

@@ -31,7 +31,7 @@ type AuthorizerListParam struct {
31 31
 // AuthorizerListResult 拉取所有已授权的帐号信息结果
32 32
 type AuthorizerListResult struct {
33 33
 	wxerr.Error
34
-	TotalCount float64               `json:"total_count"`
34
+	TotalCount int                   `json:"total_count"`
35 35
 	List       []AuthorizerBasicInfo `json:"list"`
36 36
 }
37 37
 

+ 3
- 3
authorizer/types.go Voir le fichier

@@ -14,7 +14,7 @@ package authorizer
14 14
 
15 15
 // AuthorizerBasicInfo 公众号/小程序帐号基本信息
16 16
 type AuthorizerBasicInfo struct {
17
-	AuthorizerAppid string  `json:"authorizer_appid"`
18
-	RefreshToken    string  `json:"refresh_token"`
19
-	AuthTime        float64 `json:"auth_time"`
17
+	AuthorizerAppid string `json:"authorizer_appid"`
18
+	RefreshToken    string `json:"refresh_token"`
19
+	AuthTime        int64  `json:"auth_time"`
20 20
 }

+ 3
- 3
errors/error.go Voir le fichier

@@ -16,10 +16,10 @@ import "fmt"
16 16
 
17 17
 // Error 通用错误
18 18
 type Error struct {
19
-	Code    float64 `json:"errcode"`
20
-	Message string  `json:"errmsg"`
19
+	Code    int    `json:"errcode"`
20
+	Message string `json:"errmsg"`
21 21
 }
22 22
 
23 23
 func (e Error) Error() string {
24
-	return fmt.Sprintf("[%d] - %s", int(e.Code), e.Message)
24
+	return fmt.Sprintf("[%d] - %s", e.Code, e.Message)
25 25
 }