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
| package bhomedbapi
|
| import (
| jsoniter "github.com/json-iterator/go"
| )
|
| type SysMenuApi struct {
| }
|
| func (api SysMenuApi) MenuTree(userId string) (bool, interface{}) {
| url := DATA_URL_PREFIX + "/menu/tree"
| netNode := getNetNode(url2Topic(Topic_System_Service, url))
| client := NewClient(WithNodes(netNode))
| query := map[string]string{
| "userId": userId,
| }
| body, err := client.DoGetRequest(url, query, nil)
| if err != nil {
| return false, nil
| }
|
| var json = jsoniter.ConfigCompatibleWithStandardLibrary
| var res Result
| if err = json.Unmarshal(body, &res); err != nil {
| return false, nil
| }
| return true, res.Data
| }
|
|