Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
luojielin committed Aug 29, 2021
1 parent ec83d5b commit 436bad5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lib/management/organization_management_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ func (c *Client) ExportAll() ([]model.OrgNode, error) {
}
var response model.ExportAllOrganizationResponse
log.Println(string(b))
jsoniter.Unmarshal(b, &response)
err = jsoniter.Unmarshal(b, &response)
if err != nil {
log.Println(err)
}
return response.Data, nil
}

Expand Down
16 changes: 14 additions & 2 deletions lib/management/organization_management_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,23 @@ import (
)

const (
userPoolId = "60e043f8cd91b87d712b6365"
appSecret = "158c7679333bc196b524d78d745813e5"
//userPoolId = "60e043f8cd91b87d712b6365"
//appSecret = "158c7679333bc196b524d78d745813e5"
userPoolId = "6114ea3b25851f2e44db357f"
appSecret = "4f673a16f53cbbf54633212b1a882a2a"
)

func TestClient_ExportAll(t *testing.T) {
client := NewClient(userPoolId, appSecret)
log.Println("==========导出所有组织机构数据==========")
resp, err := client.ExportAll()
if err != nil {
log.Println(err)
}
log.Printf("%+v\n", resp)
}

func TestClient_All(t *testing.T) {
client := NewClient(userPoolId, appSecret)
log.Println("==========导出所有组织机构数据==========")
resp, _ := client.ExportAll()
Expand Down
1 change: 0 additions & 1 deletion lib/model/vo_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ type OrgNode struct {
UpdatedAt *string `json:"updatedAt"`
UserPoolId *string `json:"userPoolId"`
Name string `json:"name"`
NameI18n *string `json:"nameI18n"`
Description *string `json:"description"`
DescriptionI18n *string `json:"descriptionI18n"`
Order *int64 `json:"order"`
Expand Down

0 comments on commit 436bad5

Please sign in to comment.