33 lines
654 B
Go
33 lines
654 B
Go
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"` // 错误消息
|
|
|
|
}
|