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:
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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, ","))
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
//获取视频号绑定状态
|
||||
// 获取视频号绑定状态
|
||||
corpQualification = "https://qyapi.weixin.qq.com/cgi-bin/kf/get_corp_qualification?access_token=%s"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
//发送消息
|
||||
// 发送消息
|
||||
sendMsgAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/send_msg?access_token=%s"
|
||||
)
|
||||
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
//获取消息
|
||||
// 获取消息
|
||||
syncMsgAddr = "https://qyapi.weixin.qq.com/cgi-bin/kf/sync_msg?access_token=%s"
|
||||
)
|
||||
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user