fix
liuxiaolong
2021-06-04 33b8e2242e05043f36af0570ad889000cc5b4524
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
package bhomedbapi
 
import (
    "encoding/json"
)
 
type SysRoleApi struct {
 
}
 
func (api SysRoleApi) FindAll() (bool,interface{}) {
    url := DATA_URL_PREFIX + "/role/findAll"
    netNode := getNetNode(url2Topic(Topic_System_Service, url))
    client := NewClient(WithNodes(netNode))
    body, err := client.DoGetRequest(url, nil, nil)
    if err != nil {
        return false,nil
    }
 
    var res Result
    if err = json.Unmarshal(body, &res); err != nil {
        return false,nil
    }
    return true,res.Data
}