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 }