Skip to content

Commit

Permalink
完善SDK错误类型
Browse files Browse the repository at this point in the history
  • Loading branch information
NICEXAI committed Jul 31, 2021
1 parent 25d055d commit 78fe553
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type CustomerSchema struct {
NickName string `json:"nickname"` // 微信昵称
Avatar string `json:"avatar"` // 微信头像。第三方不可获取
Gender int `json:"gender"` // 性别
UnionID string `json:"unionid"` // unionid,需要绑定微信开发者帐号才能获取到,查看绑定方法: https://open.work.weixin.qq.com/kf/doc/92512/93143/94769#%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%BE%AE%E4%BF%A1%E5%AE%A2%E6%88%B7%E7%9A%84unionid
UnionID string `json:"unionid"` // unionid,需要绑定微信开发者帐号才能获取到,查看绑定方法: https://open.work.weixin.qq.com/kf/doc/92512/93143/94769#%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%BE%AE%E4%BF%A1%E5%AE%A2%E6%88%B7%E7%9A%84unionid
}

// CustomerBatchGetSchema 获取客户基本信息响应内容
Expand Down
4 changes: 4 additions & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const (
SDKUnknownError Error = "未知错误"
// SDKInvalidCredential 错误码:40001
SDKInvalidCredential Error = "不合法的secret参数"
// SDKInvalidCorpID 错误码:40013
SDKInvalidCorpID Error = "无效的 CorpID"
// SDKAccessTokenInvalid 错误码:40014
SDKAccessTokenInvalid Error = "AccessToken 无效"
// SDKAccessTokenExpired 错误码:42001
Expand All @@ -41,6 +43,8 @@ func NewSDKErr(code int, msgList ...string) Error {
return SDKInvalidCredential
case 42001:
return SDKAccessTokenExpired
case 40013:
return SDKInvalidCorpID
case 40014:
return SDKAccessTokenInvalid
case 95011:
Expand Down

0 comments on commit 78fe553

Please sign in to comment.