新增企业微信
This commit is contained in:
40
platformapi/enterprise_wechat/enterprise_test.go
Normal file
40
platformapi/enterprise_wechat/enterprise_test.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package enterprise_wechat
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"go.uber.org/zap"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
api *API
|
||||
sugarLogger *zap.SugaredLogger
|
||||
)
|
||||
|
||||
func init() {
|
||||
logger, _ := zap.NewDevelopment()
|
||||
sugarLogger = logger.Sugar()
|
||||
baseapi.Init(sugarLogger)
|
||||
api = New("ww9a156bfa070e1857", "JQsEmSTltHhNgdPIT320YJFphiYmRs-YZa-rCBwplss")
|
||||
//api = New("6705486294797503379", "c1e6c280-e618-4103-9d0a-673bc54fb22e", "5375691", "cabrXQf9eFMVWVYg4hNlwu")
|
||||
//token, _ := api.GetAccessToken()
|
||||
//api.accessToken = token.BusinessDataObj.AccessToken
|
||||
}
|
||||
|
||||
func TestGetToken(t *testing.T) {
|
||||
api = New("ww9a156bfa070e1857", "JQsEmSTltHhNgdPIT320YJFphiYmRs-YZa-rCBwplss")
|
||||
token, err := api.GetAccessToken()
|
||||
if err != nil {
|
||||
fmt.Println("err=", err)
|
||||
}
|
||||
fmt.Println("errmsg:=", token.ErrMsg)
|
||||
fmt.Println("errmsg:=", token.AccessToken)
|
||||
fmt.Println("errmsg:=", token.ExpiresIn)
|
||||
fmt.Println("errmsg api token:=", api.accessToken)
|
||||
fmt.Println("errmsg api expiresin time:=", api.expiresIn)
|
||||
}
|
||||
|
||||
func TestAPI_GetDepartmentList(t *testing.T) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user