liuxiaolong
2021-12-09 40ef8d96ae3696aded2c14c3c80f93af39bd1169
add sysInitApi
1个文件已添加
28 ■■■■■ 已修改文件
sysInitApi.go 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sysInitApi.go
New file
@@ -0,0 +1,28 @@
package bhomedbapi
import (
    "encoding/json"
)
type SysInitApi struct {
}
//获取服务器本机配置信息
func (api SysInitApi) GetRegInfo() (bool,interface{}){
    url := DATA_URL_PREFIX + "/sysinit/getRegInfo"
    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 res.Success, res.Data
}