浏览代码

change package name

张延森 3 年前
父节点
当前提交
eabf218566

entity/authorization_change_notice.go → entities/authorization_change_notice.go 查看文件

@@ -1,4 +1,4 @@
1
-package entity
1
+package entities
2 2
 
3 3
 // AuthorizationChangeNotice 授权变更通知
4 4
 type AuthorizationChangeNotice struct {

entity/authorization_info.go → entities/authorization_info.go 查看文件

@@ -1,4 +1,4 @@
1
-package entity
1
+package entities
2 2
 
3 3
 // AuthorizationInfo 授权信息
4 4
 type AuthorizationInfo struct {

entity/authorizer_info.go → entities/authorizer_info.go 查看文件

@@ -1,4 +1,4 @@
1
-package entity
1
+package entities
2 2
 
3 3
 // AuthorizerBasicInfo 公众号/小程序帐号基本信息
4 4
 type AuthorizerBasicInfo struct {

entity/business_info.go → entities/business_info.go 查看文件

@@ -1,4 +1,4 @@
1
-package entity
1
+package entities
2 2
 
3 3
 // BusinessInfo 功能的开通状况(0代表未开通,1代表已开通)
4 4
 type BusinessInfo struct {

entity/entity.go → entities/entity.go 查看文件

@@ -1,4 +1,4 @@
1
-package entity
1
+package entities
2 2
 
3 3
 // Enum 通用枚举类型
4 4
 type Enum struct {

entity/error.go → entities/error.go 查看文件

@@ -1,4 +1,4 @@
1
-package entity
1
+package entities
2 2
 
3 3
 import "fmt"
4 4
 

entity/func_info.go → entities/func_info.go 查看文件

@@ -1,4 +1,4 @@
1
-package entity
1
+package entities
2 2
 
3 3
 // FuncInfo 权限
4 4
 type FuncInfo struct {

entity/mini_program_info.go → entities/mini_program_info.go 查看文件

@@ -1,4 +1,4 @@
1
-package entity
1
+package entities
2 2
 
3 3
 // MiniProgramNetwork 小程序配置的合法域名信息
4 4
 type MiniProgramNetwork struct {

+ 9
- 0
interfaces/log.go 查看文件

@@ -0,0 +1,9 @@
1
+package interfaces
2
+
3
+type Logger interface {
4
+	// Error 级别日志
5
+	Error(...interface{})
6
+
7
+	// Info 级别错误
8
+	Info(...interface{})
9
+}

+ 4
- 4
service/authorizer_info.go 查看文件

@@ -6,7 +6,7 @@ import (
6 6
 	"net/url"
7 7
 
8 8
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/api"
9
-	"gitee.com/yansen_zh/wechat-oplatform-sdk/entity"
9
+	"gitee.com/yansen_zh/wechat-oplatform-sdk/entities"
10 10
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils"
11 11
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils/request"
12 12
 )
@@ -19,9 +19,9 @@ type AuthorizerInfoParam struct {
19 19
 
20 20
 // AuthorizerInfoResult 获取授权帐号信息结果
21 21
 type AuthorizerInfoResult struct {
22
-	entity.Error
23
-	AuthorizationInfo entity.AuthorizationInfo `json:"authorization_info"`
24
-	AuthorizerInfo    entity.AuthorizerInfo    `json:"authorizer_info"`
22
+	entities.Error
23
+	AuthorizationInfo entities.AuthorizationInfo `json:"authorization_info"`
24
+	AuthorizerInfo    entities.AuthorizerInfo    `json:"authorizer_info"`
25 25
 }
26 26
 
27 27
 // GetAuthorizerInfo 获取授权帐号信息

+ 4
- 4
service/authorizer_list.go 查看文件

@@ -6,7 +6,7 @@ import (
6 6
 	"net/url"
7 7
 
8 8
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/api"
9
-	"gitee.com/yansen_zh/wechat-oplatform-sdk/entity"
9
+	"gitee.com/yansen_zh/wechat-oplatform-sdk/entities"
10 10
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils"
11 11
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils/request"
12 12
 )
@@ -20,9 +20,9 @@ type AuthorizerListParam struct {
20 20
 
21 21
 // AuthorizerListResult 拉取所有已授权的帐号信息结果
22 22
 type AuthorizerListResult struct {
23
-	entity.Error
24
-	TotalCount float64                      `json:"total_count"`
25
-	List       []entity.AuthorizerBasicInfo `json:"list"`
23
+	entities.Error
24
+	TotalCount float64                        `json:"total_count"`
25
+	List       []entities.AuthorizerBasicInfo `json:"list"`
26 26
 }
27 27
 
28 28
 // AuthorizerList 拉取所有已授权的帐号信息

+ 3
- 3
service/authorizer_option.go 查看文件

@@ -6,7 +6,7 @@ import (
6 6
 	"net/url"
7 7
 
8 8
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/api"
9
-	"gitee.com/yansen_zh/wechat-oplatform-sdk/entity"
9
+	"gitee.com/yansen_zh/wechat-oplatform-sdk/entities"
10 10
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils"
11 11
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils/request"
12 12
 )
@@ -20,7 +20,7 @@ type GetAuthorizerOptionParam struct {
20 20
 
21 21
 // GetAuthorizerOptionResult 获取授权方选项信息结果
22 22
 type GetAuthorizerOptionResult struct {
23
-	entity.Error
23
+	entities.Error
24 24
 	AuthorizerAppId string `json:"authorizer_appid"`
25 25
 	OptionName      string `json:"option_name"`
26 26
 	OptionValue     string `json:"option_value"`
@@ -80,7 +80,7 @@ type SetAuthorizerOptionParam struct {
80 80
 
81 81
 // SetAuthorizerOptionResult 设置授权方选项信息结果
82 82
 type SetAuthorizerOptionResult struct {
83
-	entity.Error
83
+	entities.Error
84 84
 }
85 85
 
86 86
 // SetAuthorizerOption 设置授权方选项信息

+ 2
- 2
service/authorizer_token.go 查看文件

@@ -6,7 +6,7 @@ import (
6 6
 	"net/url"
7 7
 
8 8
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/api"
9
-	"gitee.com/yansen_zh/wechat-oplatform-sdk/entity"
9
+	"gitee.com/yansen_zh/wechat-oplatform-sdk/entities"
10 10
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils"
11 11
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils/request"
12 12
 )
@@ -20,7 +20,7 @@ type AuthorizerTokenParam struct {
20 20
 
21 21
 // AuthorizerTokenResult 获取/刷新接口调用令牌结果
22 22
 type AuthorizerTokenResult struct {
23
-	entity.Error
23
+	entities.Error
24 24
 	AuthorizerAccessToken  string  `json:"authorizer_access_token"`
25 25
 	ExpiresIn              float64 `json:"expires_in"`
26 26
 	AuthorizerRefreshToken string  `json:"authorizer_refresh_token"`

+ 2
- 2
service/component_token.go 查看文件

@@ -5,7 +5,7 @@ import (
5 5
 	"errors"
6 6
 
7 7
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/api"
8
-	"gitee.com/yansen_zh/wechat-oplatform-sdk/entity"
8
+	"gitee.com/yansen_zh/wechat-oplatform-sdk/entities"
9 9
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils/request"
10 10
 )
11 11
 
@@ -18,7 +18,7 @@ type ComponentTokenParam struct {
18 18
 
19 19
 // ComponentTokenResult 获取令牌结果
20 20
 type ComponentTokenResult struct {
21
-	entity.Error
21
+	entities.Error
22 22
 	ComponentAccessToken string  `json:"component_access_token"`
23 23
 	ExpiresIn            float64 `json:"expires_in"`
24 24
 }

+ 2
- 2
service/pre_auth_code.go 查看文件

@@ -6,7 +6,7 @@ import (
6 6
 	"net/url"
7 7
 
8 8
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/api"
9
-	"gitee.com/yansen_zh/wechat-oplatform-sdk/entity"
9
+	"gitee.com/yansen_zh/wechat-oplatform-sdk/entities"
10 10
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils"
11 11
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils/request"
12 12
 )
@@ -18,7 +18,7 @@ type PreAuthCodeParam struct {
18 18
 
19 19
 // PreAuthCodeResult 获取预授权码结果
20 20
 type PreAuthCodeResult struct {
21
-	entity.Error
21
+	entities.Error
22 22
 	PreAuthCode string  `json:"pre_auth_code"`
23 23
 	ExpiresIn   float64 `json:"expires_in"`
24 24
 }

+ 2
- 2
service/push_ticket.go 查看文件

@@ -5,7 +5,7 @@ import (
5 5
 	"errors"
6 6
 
7 7
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/api"
8
-	"gitee.com/yansen_zh/wechat-oplatform-sdk/entity"
8
+	"gitee.com/yansen_zh/wechat-oplatform-sdk/entities"
9 9
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils/request"
10 10
 )
11 11
 
@@ -17,7 +17,7 @@ type PushTicketParam struct {
17 17
 
18 18
 // PushTicketResult 启动票据推送服务参数
19 19
 type PushTicketResult struct {
20
-	entity.Error
20
+	entities.Error
21 21
 }
22 22
 
23 23
 // StartPushTicket 启动 ticket 推送服务

+ 3
- 3
service/query_auth.go 查看文件

@@ -6,7 +6,7 @@ import (
6 6
 	"net/url"
7 7
 
8 8
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/api"
9
-	"gitee.com/yansen_zh/wechat-oplatform-sdk/entity"
9
+	"gitee.com/yansen_zh/wechat-oplatform-sdk/entities"
10 10
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils"
11 11
 	"gitee.com/yansen_zh/wechat-oplatform-sdk/utils/request"
12 12
 )
@@ -19,8 +19,8 @@ type QueryAuthParam struct {
19 19
 
20 20
 // QueryAuthResult 获取授权信息结果
21 21
 type QueryAuthResult struct {
22
-	entity.Error
23
-	AuthorizationInfo entity.AuthorizationInfo `json:"authorization_info"`
22
+	entities.Error
23
+	AuthorizationInfo entities.AuthorizationInfo `json:"authorization_info"`
24 24
 }
25 25
 
26 26
 // QueryAuth 获取授权信息