-
Notifications
You must be signed in to change notification settings - Fork 0
/
define.go
48 lines (35 loc) · 1.05 KB
/
define.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package utils
/**
* @PROJECT_NAME wechat
* @author Moqi
* @date 2021-04-12 08:51
* @Email:str@li.cm
**/
const domain Domain = "https://api.weixin.qq.com"
var expiredToken = MapBoolean{
"42001":true, //40001 获取 access_token 时 AppSecret 错误,或者 access_token 无效。请开发者认真比对 AppSecret 的正确性,或查看是否正在为恰当的公众号调用接口
"40001":true, //42001 access_token 超时,请检查 access_token 的有效期,请参考基础支持 - 获取 access_token 中,对 access_token 的详细机制说明
}
type App interface {
GetAccessToken(reflush ...bool) (*Token)
GetConfig() (Config)
}
type Config struct {
Appid string
Secret string
}
type Token struct {
Token string
UpdateTime int
}
type ContextToken struct {
Appid string
Token string
}
//Hook [0] Appid [1] AccessToken
type Hook func(appidAndAccessToken ...string) *Token
type Domain string
type MapStr map[string]string
type Query map[string]string
type MapBoolean map[string]bool
type MapInterface map[string]interface{}