소스 검색

change names

张延森 3 년 전
부모
커밋
caf2d2f21f

+ 2
- 2
authorization/authorizer_token.go 파일 보기

@@ -40,8 +40,8 @@ const (
40 40
 	apiAuthorizerToken = "https://apies.weixin.qq.com/cgi-bin/component/api_authorizer_token"
41 41
 )
42 42
 
43
-// AuthorizerToken 获取/刷新接口调用令牌
44
-func AuthorizerToken(componentAccessToken string, data AuthorizerTokenParam) (*AuthorizerTokenResult, error) {
43
+// RefreshAuthorizerToken 获取/刷新接口调用令牌
44
+func RefreshAuthorizerToken(componentAccessToken string, data AuthorizerTokenParam) (*AuthorizerTokenResult, error) {
45 45
 	if componentAccessToken == "" {
46 46
 		return nil, errors.New("获取/刷新接口调用令牌 第三方平台的 component_access_token 不能为空")
47 47
 	}

+ 10
- 10
authorization/bind_component.go 파일 보기

@@ -20,8 +20,8 @@ import (
20 20
 	"gitee.com/yansen_zh/wxcomponent/utils/request"
21 21
 )
22 22
 
23
-// BindComponentParam 构建授权链接入参
24
-type BindComponentParam struct {
23
+// AuthLinkParam 构建授权链接入参
24
+type AuthLinkParam struct {
25 25
 	ComponentAppId string
26 26
 	PreAuthCode    string
27 27
 
@@ -36,18 +36,18 @@ const (
36 36
 	bindcomponent      = "https://mp.weixin.qq.com/safe/bindcomponent"
37 37
 )
38 38
 
39
-// BindComponentByPC 构建PC端授权链接
40
-func BindComponentByPC(param BindComponentParam) (*url.URL, error) {
41
-	return BindComponent("PC", param)
39
+// GetPCAuthLink 构建PC端授权链接
40
+func GetPCAuthLink(param AuthLinkParam) (*url.URL, error) {
41
+	return GetAuthLink("PC", param)
42 42
 }
43 43
 
44
-// BindComponentByH5 构建H5端授权链接
45
-func BindComponentByH5(param BindComponentParam) (*url.URL, error) {
46
-	return BindComponent("H5", param)
44
+// GetH5AuthLink 构建H5端授权链接
45
+func GetH5AuthLink(param AuthLinkParam) (*url.URL, error) {
46
+	return GetAuthLink("H5", param)
47 47
 }
48 48
 
49
-// BindComponent 构建授权链接
50
-func BindComponent(client string, param BindComponentParam) (*url.URL, error) {
49
+// GetAuthLink 构建授权链接
50
+func GetAuthLink(client string, param AuthLinkParam) (*url.URL, error) {
51 51
 	isH5 := client == "H5"
52 52
 
53 53
 	if param.ComponentAppId == "" {

+ 2
- 2
authorization/component_token.go 파일 보기

@@ -38,8 +38,8 @@ const (
38 38
 	apiComponentToken = "https://apies.weixin.qq.com/cgi-bin/component/api_component_token"
39 39
 )
40 40
 
41
-// ComponentVerifyTicket 获取令牌
42
-func ComponentToken(data ComponentTokenParam) (*ComponentTokenResult, error) {
41
+// GetComponentToken 获取令牌
42
+func GetComponentToken(data ComponentTokenParam) (*ComponentTokenResult, error) {
43 43
 	if data.ComponentAppId == "" {
44 44
 		return nil, errors.New("获取令牌 第三方平台的 appid 不能为空")
45 45
 	}

+ 2
- 2
authorization/push_ticket.go 파일 보기

@@ -35,8 +35,8 @@ const (
35 35
 	apiStartPushTicket = "https://apies.weixin.qq.com/cgi-bin/component/api_start_push_ticket"
36 36
 )
37 37
 
38
-// StartPushTicket 启动 ticket 推送服务
39
-func StartPushTicket(data PushTicketParam) (*PushTicketResult, error) {
38
+// PushTicket 启动 ticket 推送服务
39
+func PushTicket(data PushTicketParam) (*PushTicketResult, error) {
40 40
 	if data.ComponentAppId == "" {
41 41
 		return nil, errors.New("启动 ticket 推送服务 第三方平台的 appid 不能为空")
42 42
 	}

+ 2
- 2
authorization/query_auth.go 파일 보기

@@ -37,8 +37,8 @@ const (
37 37
 	apiQueryAuth = "https://apies.weixin.qq.com/cgi-bin/component/api_query_auth"
38 38
 )
39 39
 
40
-// QueryAuth 获取授权信息
41
-func QueryAuth(componentAccessToken string, data QueryAuthParam) (*QueryAuthResult, error) {
40
+// GetQueryAuth 获取授权信息
41
+func GetQueryAuth(componentAccessToken string, data QueryAuthParam) (*QueryAuthResult, error) {
42 42
 	if componentAccessToken == "" {
43 43
 		return nil, errors.New("获取授权信息 第三方平台的 component_access_token 不能为空")
44 44
 	}

+ 5
- 5
authorization/verify_ticket.go 파일 보기

@@ -18,22 +18,22 @@ import (
18 18
 	"gitee.com/yansen_zh/wxcomponent/utils/encrypt"
19 19
 )
20 20
 
21
-// ComponentVerifyTicketResult 获取验证票据结果
22
-type ComponentVerifyTicketResult struct {
21
+// VerifyTicketResult 获取验证票据结果
22
+type VerifyTicketResult struct {
23 23
 	AppId                 string `xml:"AppId"`
24 24
 	CreateTime            int64  `xml:"CreateTime"`
25 25
 	InfoType              string `xml:"InfoType"`
26 26
 	ComponentVerifyTicket string `xml:"ComponentVerifyTicket"`
27 27
 }
28 28
 
29
-// ComponentVerifyTicket 获取验证票据
30
-func VerifyTicket(data []byte, encodingAESKey, iv string) (*ComponentVerifyTicketResult, error) {
29
+// ParseVerifyTicket 获取验证票据
30
+func ParseVerifyTicket(data []byte, encodingAESKey, iv string) (*VerifyTicketResult, error) {
31 31
 	bt, err := encrypt.MsgDecode(data, encodingAESKey, iv)
32 32
 	if nil != err {
33 33
 		return nil, err
34 34
 	}
35 35
 
36
-	res := ComponentVerifyTicketResult{}
36
+	res := VerifyTicketResult{}
37 37
 
38 38
 	if e := xml.Unmarshal(bt, &res); e != nil {
39 39
 		return nil, e

+ 2
- 2
authorizer/authorizer_list.go 파일 보기

@@ -39,8 +39,8 @@ const (
39 39
 	apiGetAuthorizerList = "https://apies.weixin.qq.com/cgi-bin/component/api_get_authorizer_list"
40 40
 )
41 41
 
42
-// AuthorizerList 拉取所有已授权的帐号信息
43
-func AuthorizerList(componentAccessToken string, data AuthorizerListParam) (*AuthorizerListResult, error) {
42
+// GetAuthorizerList 拉取所有已授权的帐号信息
43
+func GetAuthorizerList(componentAccessToken string, data AuthorizerListParam) (*AuthorizerListResult, error) {
44 44
 	if componentAccessToken == "" {
45 45
 		return nil, errors.New("拉取所有已授权的帐号信息 第三方平台的 component_access_token 不能为空")
46 46
 	}