新增企业微信
This commit is contained in:
32
platformapi/enterprise_wechat/wechat_model.go
Normal file
32
platformapi/enterprise_wechat/wechat_model.go
Normal 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"` // 错误消息
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user