liuxiaolong
2021-04-25 cc9d7e2dfad7c634e8ce69d02ce5fc4065e809e4
syssetApi.go
@@ -13,9 +13,6 @@
func (api SysSetApi) GetServerInfo() (flag bool,sysconf protomsg.LocalConfig){
   url := DATA_URL_PREFIX + "/sysset/getServerInfo"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,sysconf
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoGetRequest(url, nil, nil)
@@ -44,9 +41,6 @@
func (api SysSetApi) AlarmEdit(paramBody map[string]interface{}) (bool,interface{}){
   url := DATA_URL_PREFIX + "/sysset/alarmEdit"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body,err := client.DoPostRequest(url,CONTENT_TYPE_JSON, paramBody,nil,nil)
   if err != nil {
@@ -64,9 +58,6 @@
func (api SysSetApi) VideoLenShow() (bool,interface{}){
   url := DATA_URL_PREFIX + "/sysset/videoLenShow"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoGetRequest(url, nil, nil)
@@ -84,9 +75,6 @@
func (api SysSetApi) VideoLenEdit(maxVideoLen string,minVideoLen string) (bool,interface{}){
   url := DATA_URL_PREFIX + "/sysset/videoLenEdit"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   paramBody :=make(map[string]interface{},0)
   paramBody["max_video_len"] = maxVideoLen
@@ -107,9 +95,6 @@
func (api SysSetApi) SaveServerInfo(paramBody map[string]interface{}) (bool,interface{}){
   url := DATA_URL_PREFIX + "/sysset/saveServerInfo"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body,err := client.DoPostRequest(url,CONTENT_TYPE_FORM, paramBody,nil,nil)
   if err != nil {
@@ -127,9 +112,6 @@
func (api SysSetApi) Gb28181ConfigShow() (bool,interface{}){
   url := DATA_URL_PREFIX + "/sysset/gb28181ConfigShow"
   netNode := getNetNode(url2Topic(Topic_Gb28181_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoGetRequest(url, nil, nil)
@@ -147,9 +129,6 @@
func (api SysSetApi) Gb28181ConfigEdit(paramBody map[string]interface{}) (bool,interface{}){
   url := DATA_URL_PREFIX + "/sysset/gb28181ConfigEdit"
   netNode := getNetNode(url2Topic(Topic_Gb28181_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body,err := client.DoPostRequest(url,CONTENT_TYPE_JSON, paramBody,nil,nil)
   if err != nil {
@@ -168,9 +147,6 @@
func (api SysSetApi) GetRemoteFullServerInfo(headers map[string]string) (flag bool,d interface{}){
   url := DATA_URL_PREFIX + "/sysset/getDevInfo"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoGetRequest(url, nil, headers)
@@ -189,9 +165,6 @@
func (api SysSetApi) GetClockInfo(headers map[string]string) (flag bool,d interface{}){
   url := DATA_URL_PREFIX + "/sysset/clockInfo"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoGetRequest(url, nil, headers)
@@ -210,9 +183,6 @@
func (api SysSetApi) TestNTPServer(query map[string]string,headers map[string]string) (flag bool,d interface{}){
   url := DATA_URL_PREFIX + "/sysset/ntpTest"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoGetRequest(url, query, headers)
@@ -231,9 +201,6 @@
func (api SysSetApi) SetSysClock(paramBody map[string]interface{},headers map[string]string) (flag bool,d interface{}){
   url := DATA_URL_PREFIX + "/sysset/updateClock"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoPostRequest(url, CONTENT_TYPE_JSON,paramBody,nil, headers)
@@ -252,9 +219,6 @@
func (api SysSetApi) GetSysInfo(headers map[string]string) (flag bool,d interface{}){
   url := DATA_URL_PREFIX + "/sysset/sysinfo"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoGetRequest(url, nil, headers)
@@ -273,9 +237,6 @@
func (api SysSetApi) GetResourceConfig() (flag bool,rc protomsg.ResourceConfig){
   url := DATA_URL_PREFIX + "/sysset/getResourceConfig"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false, rc
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoGetRequest(url, nil, nil)
@@ -303,9 +264,6 @@
func (api SysSetApi) SaveResourceConfig(paramBody map[string]interface{}) (flag bool,d interface{}){
   url := DATA_URL_PREFIX + "/sysset/saveResourceConfig"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   if netNode == nil {
      return false,nil
   }
   client := NewClient(WithNodes(netNode))
   body, err := client.DoPostRequest(url, CONTENT_TYPE_JSON,paramBody,nil, nil)
@@ -319,4 +277,23 @@
   }
   return res.Success,res.Data
}
//控制本机reboot
func (api SysSetApi) RebootOS() (bool,interface{}) {
   url := DATA_URL_PREFIX + "/sysset/reboot"
   netNode := getNetNode(url2Topic(Topic_System_Service, url))
   client := NewClient(WithNodes(netNode))
   body, err := client.DoPostRequest(url, CONTENT_TYPE_JSON,nil,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
}