example_test.go
1.6 KB
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
package example
import (
"github.com/linmadan/egglib-go/utils/json"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/allied-lib/gateway/allied_creation_user"
"testing"
)
var host = "http://127.0.0.1:8081"
func TestAlliedUserGatewayLib(t *testing.T) {
creation := allied_creation_user.NewHttpLibAlliedCreationUser(host)
user, _ := creation.UserGet(allied_creation_user.ReqGetUser{
UserId: 2,
})
t.Log(json.MarshalToString(user))
_, users, _ := creation.UserSearch(allied_creation_user.ReqUserSearch{
Offset: 60,
})
t.Log(json.MarshalToString(users))
company, _ := creation.CompanyGet(allied_creation_user.ReqCompanyGet{
CompanyId: 2,
})
t.Log(json.MarshalToString(company))
_, companies, _ := creation.CompanySearch(allied_creation_user.ReqCompanySearch{})
t.Log(json.MarshalToString(companies))
org, _ := creation.OrgGet(allied_creation_user.ReqOrgGet{
OrgId: 2,
})
t.Log(json.MarshalToString(org))
_, orgs, _ := creation.OrgSearch(allied_creation_user.ReqOrgSearch{})
t.Log(json.MarshalToString(orgs))
}
func TestAlliedUserGatewayLibQuick(t *testing.T) {
creation := allied_creation_user.NewHttpLibAlliedCreationUser(host)
user, _ := creation.User(2)
t.Log(json.MarshalToString(user))
users, _ := creation.Users([]int{2})
t.Log(json.MarshalToString(users))
company, _ := creation.Company(2)
t.Log(json.MarshalToString(company))
companies, _ := creation.Companies([]int{2})
t.Log(json.MarshalToString(companies))
org, _ := creation.Organization(2)
t.Log(json.MarshalToString(org))
orgs, _ := creation.Organizations([]int{2})
t.Log(json.MarshalToString(orgs))
}