| | |
| | | |
| | | import ( |
| | | "encoding/json" |
| | | "fmt" |
| | | "strconv" |
| | | ) |
| | | |
| | |
| | | //parentId 要查寻的目录树的根节点id |
| | | //searchType(0:全部,1:分析摄像机,2:监控摄像机) |
| | | //cameraName(摄像机名称) |
| | | func (api AreaApi) GetLocalCameraTree(parentId string, searchType string, cameraName string) []TreeMenu { |
| | | func (api AreaApi) GetLocalCameraTree(parentId string, searchType string, cameraName string, isPlatform int) []TreeMenu { |
| | | var result []TreeMenu |
| | | |
| | | client := NewClient() |
| | |
| | | params["parentId"] = parentId |
| | | params["searchType"] = searchType |
| | | params["cameraName"] = cameraName |
| | | params["isPlatform"] = strconv.Itoa(isPlatform) |
| | | |
| | | respBody, err := client.DoGetRequest(url, params, nil) |
| | | if err != nil { |
| | |
| | | //parentId 要查寻的目录树的根节点id |
| | | //searchType(0:全部,1:分析摄像机,2:监控摄像机) |
| | | //cameraName(摄像机名称) |
| | | func (api AreaApi) GetGb28181CameraTree(parentId string, searchType string, cameraName string) []TreeMenu { |
| | | func (api AreaApi) GetGb28181CameraTree(parentId string, searchType string, cameraName string, isPlatform int) []TreeMenu { |
| | | var result []TreeMenu |
| | | |
| | | client := NewClient() |
| | |
| | | params["parentId"] = parentId |
| | | params["searchType"] = searchType |
| | | params["cameraName"] = cameraName |
| | | params["isPlatform"] = strconv.Itoa(isPlatform) |
| | | |
| | | respBody, err := client.DoGetRequest(url, params, nil) |
| | | if err != nil { |
| | |
| | | return result |
| | | } |
| | | |
| | | func (api AreaApi) Gb28181TreeRefresh(id string) bool { |
| | | flag := false |
| | | func (api AreaApi) Gb28181TreeRefresh(id string) (bool, interface{}) { |
| | | url := api.getBasicUrl() + DATA_URL_PREFIX + "/area/gb28181TreeRefresh" |
| | | client := NewClient() |
| | | paramBody := map[string]interface{}{ |
| | |
| | | } |
| | | respBody, err := client.DoPostRequest(url, CONTENT_TYPE_FORM, paramBody, nil, nil) |
| | | if err != nil { |
| | | return flag |
| | | return false, err.Error() |
| | | } |
| | | var res Result |
| | | if err = json.Unmarshal(respBody, &res); err != nil { |
| | | return flag |
| | | return false, err.Error() |
| | | } |
| | | flag = res.Success |
| | | return flag |
| | | return res.Success, res.Data |
| | | } |
| | | |
| | | func (api AreaApi) Gb28181TreeDelete() bool { |
| | |
| | | } |
| | | var res Result |
| | | if err = json.Unmarshal(respBody, &res); err != nil { |
| | | fmt.Println(err) |
| | | logPrint(err) |
| | | return flag |
| | | } |
| | | flag = res.Success |