-
Notifications
You must be signed in to change notification settings - Fork 3
/
client.go
46 lines (39 loc) · 953 Bytes
/
client.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
package wechatqy
import (
"github.com/dtapps/go-library/utils/golog"
"github.com/dtapps/go-library/utils/gorequest"
)
// ClientConfig 实例配置
type ClientConfig struct {
AppId string
AgentId int
Secret string
RedirectUri string
Key string // key
}
// Client 实例
type Client struct {
requestClient *gorequest.App // 请求服务
requestClientStatus bool // 请求服务状态
config struct {
appId string
agentId int
secret string
redirectUri string
key string
}
slog struct {
status bool // 状态
client *golog.ApiSLog // 日志服务
}
}
// NewClient 创建实例化
func NewClient(config *ClientConfig) (*Client, error) {
c := &Client{}
c.config.appId = config.AppId
c.config.agentId = config.AgentId
c.config.secret = config.Secret
c.config.redirectUri = config.RedirectUri
c.config.key = config.Key
return c, nil
}