forked from star-table/dingtalk-sdk-golang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_user_caller_test.go
63 lines (50 loc) · 1.76 KB
/
api_user_caller_test.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package sdk
import (
"github.com/polaris-team/dingtalk-sdk-golang/json"
"testing"
)
func TestGetDepMember(t *testing.T) {
memberList, _ := CreateClient().GetDepMemberIds("1")
t.Logf(json.ToJson(memberList))
}
func TestGetUserDetail(t *testing.T) {
memberList, _ := CreateClient().GetDepMemberIds("1")
t.Logf(json.ToJson(memberList))
resp, _ := CreateClient().GetUserDetail(memberList.UserIds[2], nil)
t.Logf(json.ToJson(resp))
}
func TestDingTalkClient_GetDepMemberList(t *testing.T) {
resp, _ := CreateClient().GetDepMemberList("1", "", 1, 5, "")
t.Logf(json.ToJson(resp))
}
func TestDingTalkClient_GetDepMemberDetailList(t *testing.T) {
resp, _ := CreateClient().GetDepMemberDetailList("1", "", 1, 5, "")
t.Logf(json.ToJson(resp))
}
func TestDingTalkClient_GetAdminList(t *testing.T) {
resp, _ := CreateClient().GetAdminList()
t.Logf(json.ToJson(resp))
}
func TestDingTalkClient_GetAdminScope(t *testing.T) {
adminList, _ := CreateClient().GetAdminList()
resp, _ := CreateClient().GetAdminScope(adminList.AdminList[0].UserId)
t.Logf(json.ToJson(resp))
}
func TestDingTalkClient_CanAccessMicroApp(t *testing.T) {
client := CreateClient()
adminList, _ := client.GetAdminList()
resp, _ := client.CanAccessMicroApp(adminList.AdminList[1].UserId, "22790")
t.Logf(json.ToJson(resp))
}
func TestDingTalkClient_GetUserIdByUnionId(t *testing.T) {
memberDetailList, _ := CreateClient().GetDepMemberDetailList("1", "", 0, 1, "")
t.Log(json.ToJson(memberDetailList))
resp, _ := CreateClient().GetUserIdByUnionId(memberDetailList.UserList[0].UnionId)
t.Log(json.ToJson(resp))
}
func TestDingTalkClient_GetOrgUserCount(t *testing.T) {
resp, _ := CreateClient().GetOrgUserCount(0)
t.Log(json.ToJson(resp))
resp, _ = CreateClient().GetOrgUserCount(1)
t.Log(json.ToJson(resp))
}