新增企业微信

This commit is contained in:
邹宗楠
2022-05-23 11:57:44 +08:00
parent 709da734ab
commit 8e8d03c5fa
5 changed files with 216 additions and 4 deletions

View File

@@ -0,0 +1,32 @@
package enterprise_wechat
import (
"git.rosy.net.cn/baseapi/platformapi"
"net/http"
"sync"
)
const (
WeChatBaseApi = "https://qyapi.weixin.qq.com" // 企业微信基础访问链接
// api接口
GetToken = "cgi-bin/gettoken" // 获取token
)
// 注册请求api
type API struct {
corpId string // 企业号
corpSecret string // 秘钥
accessToken string // token
expiresIn int64 // token过期时间
locker sync.RWMutex
client *http.Client
config *platformapi.APIConfig
}
// 公共错误码
type PublicCode struct {
ErrCode int `json:"errcode"` // 错误码
ErrMsg string `json:"errmsg"` // 错误消息
}