1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 12:52:27 +08:00

Adaptation of new go-redis components (#546)

* [feature] Format the code and improve Mini Program authorization to obtain openid(miniprogram/auth/auth.go Code2Session)

* [feature] CheckEncryptedData (https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html)

* upgrade json error

* upgrade json error

* [feature] Wallet Transfer returns the pointer object

* feat:Adaptation of new go-redis components

* improve code

* feat:upgrade golangci-lint-action version

* fix

* test ci

* fix

* test ci

* fix

* test

* improve code

* feat:GetPhoneNumber return ptr

Co-authored-by: houseme <houseme@outlook.com>
This commit is contained in:
houseme
2022-04-14 10:07:58 +08:00
committed by GitHub
parent 1b5c5fba67
commit 8e81a416c5
30 changed files with 232 additions and 153 deletions

View File

@@ -8,7 +8,7 @@ import (
)
const (
//添加客服账号
// 添加客服账号
accountAddAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/account/add?access_token=%s"
// 删除客服账号
accountDelAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/account/del?access_token=%s"
@@ -16,7 +16,7 @@ const (
accountUpdateAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/account/update?access_token=%s"
// 获取客服账号列表
accountListAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/account/list?access_token=%s"
//获取客服账号链接
// 获取客服账号链接
addContactWayAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/add_contact_way?access_token=%s"
)

View File

@@ -23,7 +23,7 @@ func NewClient(cfg *config.Config) (client *Client, err error) {
return nil, NewSDKErr(50001)
}
//初始化 AccessToken Handle
// 初始化 AccessToken Handle
defaultAkHandle := credential.NewWorkAccessToken(cfg.CorpID, cfg.CorpSecret, credential.CacheKeyWorkPrefix, cfg.Cache)
ctx := &context.Context{
Config: cfg,

View File

@@ -51,7 +51,7 @@ const (
SDKApiNotOpen Error = "API 功能没有被开启"
)
//Error 输出错误信息
// Error 输出错误信息
func (r Error) Error() string {
return reflect.ValueOf(r).String()
}
@@ -85,7 +85,7 @@ func NewSDKErr(code int64, msgList ...string) error {
return err
}
//返回未知的自定义错误
// 返回未知的自定义错误
if len(msgList) > 0 {
return Error(strings.Join(msgList, ","))
}

View File

@@ -8,7 +8,7 @@ import (
)
const (
//获取视频号绑定状态
// 获取视频号绑定状态
corpQualification = "https://qyapi.weixin.qq.com/cgi-bin/kf/get_corp_qualification?access_token=%s"
)

View File

@@ -8,7 +8,7 @@ import (
)
const (
//发送消息
// 发送消息
sendMsgAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/send_msg?access_token=%s"
)

View File

@@ -31,7 +31,7 @@ type SendMsgOnEventSchema struct {
// 从接待池接入会话,用于发送非工作时间的提示语或超时未回复的提示语等 1条 48小时 文本 事件回调、转接会话接口
// 结束会话,用于发送结束会话提示语或满意度评价等 1条 20秒 文本、菜单 事件回调、转接会话接口
//
//「进入会话事件」响应消息:
// 「进入会话事件」响应消息:
// 如果满足通过API下发欢迎语条件条件为1. 企业没有在管理端配置了原生欢迎语2. 用户在过去48小时里未收过欢迎语且未向该用户发过消息则用户进入会话事件会额外返回一个welcome_code开发者以此为凭据调用接口填到该接口code参数即可向客户发送客服欢迎语。
func (r *Client) SendMsgOnEvent(options interface{}) (info SendMsgOnEventSchema, err error) {
var (

View File

@@ -8,11 +8,11 @@ import (
)
const (
//添加接待人员
// 添加接待人员
receptionistAddAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/servicer/add?access_token=%s"
//删除接待人员
// 删除接待人员
receptionistDelAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/servicer/del?access_token=%s"
//获取接待人员列表
// 获取接待人员列表
receptionistListAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/servicer/list?access_token=%s&open_kfid=%s"
)

View File

@@ -10,7 +10,7 @@ import (
)
const (
//获取消息
// 获取消息
syncMsgAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/sync_msg?access_token=%s"
)

View File

@@ -8,11 +8,11 @@ import (
)
const (
//获取配置的专员与客户群
// 获取配置的专员与客户群
upgradeServiceConfigAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/customer/get_upgrade_service_config?access_token=%s"
// 为客户升级为专员或客户群服务
upgradeService = "https://qyapi.weixin.qq.com/cgi-bin/kf/customer/upgrade_service?access_token=%s"
//为客户取消推荐
// 为客户取消推荐
upgradeServiceCancel = "https://qyapi.weixin.qq.com/cgi-bin/kf/customer/cancel_upgrade_service?access_token=%s"
)