| | |
| | | import cn.gistack.sm.hk.constant.ProtocolConstant; |
| | | import cn.gistack.sm.hk.service.HkService; |
| | | import cn.gistack.sm.hk.vo.HkVO; |
| | | import cn.gistack.sm.hk.vo.VideoVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.gistack.sm.hk.util.GetCameraUtils.*; |
| | |
| | | return R.data(common(null==hk.getType()?1:hk.getType(),HkConstant.presetsDeletionURLs, body)); |
| | | } |
| | | |
| | | /** |
| | | * 同步水库设备信息 |
| | | * @param hk 水库设备 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "海康设备-同步水库设备信息", notes = "海康设备-同步水库设备信息") |
| | | @PostMapping(value = "/syncVideo") |
| | | public R syncVideo(@RequestBody HkVO hk) { |
| | | /** |
| | | * 组装请求参数 |
| | | */ |
| | | List<VideoVO> list = new ArrayList<>(); |
| | | VideoVO video = new VideoVO(); |
| | | video.setRegionName(hk.getRegionName()); |
| | | video.setRegionIndexCode(hk.getRegionIndexCode()); |
| | | video.setParentIndexCode("root000000"); |
| | | video.setRegionType(10); |
| | | list.add(video); |
| | | String body = JSON.toJSONString(list); |
| | | |
| | | /** |
| | | * 调用接口并返回数据 |
| | | * post请求application/json类型参数; |
| | | */ |
| | | return R.data(JSONObject.parseObject(common(null==hk.getType()?2:hk.getType(),HkConstant.batchAddURLs, body))); |
| | | } |
| | | |
| | | } |