package dbapi import "encoding/json" type SysRoleApi struct { } func (sra SysRoleApi) FindAll() (bool,interface{}) { url := BASIC_URL + DATA_URL_PREFIX + "/role/findAll" client := NewClient() 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 }