From a41d0a0b7e39509a31f0d963470cbe484fadea3c Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Tue, 17 May 2022 11:43:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=95=86=E6=B1=A4=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/config/RestClient.java | 10 +- .../monitormanage/controller/Controller.java | 21 +---- .../controller/ShangTangController.java | 68 ++++++++++++++ .../monitormanage/service/MonitorService.java | 71 -------------- .../service/ShangTangService.java | 93 +++++++++++++++++++ 5 files changed, 169 insertions(+), 94 deletions(-) create mode 100644 src/main/java/com/hisense/monitormanage/controller/ShangTangController.java create mode 100644 src/main/java/com/hisense/monitormanage/service/ShangTangService.java diff --git a/src/main/java/com/hisense/monitormanage/config/RestClient.java b/src/main/java/com/hisense/monitormanage/config/RestClient.java index 4cc94a8..ec53fea 100644 --- a/src/main/java/com/hisense/monitormanage/config/RestClient.java +++ b/src/main/java/com/hisense/monitormanage/config/RestClient.java @@ -5,6 +5,10 @@ import org.springframework.context.annotation.Configuration; import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.SocketAddress; + @Configuration public class RestClient { @@ -16,9 +20,9 @@ public class RestClient { requestFactory.setReadTimeout(30000); requestFactory.setOutputStreaming(false); -// SocketAddress address = new InetSocketAddress("127.0.0.1", 8888); -// Proxy proxy = new Proxy(Proxy.Type.HTTP, address); -// requestFactory.setProxy(proxy); + /*SocketAddress address = new InetSocketAddress("15.2.23.141", 8888); + Proxy proxy = new Proxy(Proxy.Type.HTTP, address); + requestFactory.setProxy(proxy);*/ RestTemplate restTemplate = new RestTemplate(); restTemplate.setRequestFactory(requestFactory); diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index 2629baa..9aaee9f 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -6,6 +6,7 @@ import com.hisense.monitormanage.entity.*; import com.hisense.monitormanage.mapper.*; import com.hisense.monitormanage.service.*; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -267,26 +268,6 @@ public class Controller { return success; } - /** - * 订阅任务下发接口 - * @return - */ - @RequestMapping("subscribe") - public JSONObject subscribe(){ - return monitorService.subscribe(); - } - - - /** - * 事件模板分页查询接口 - * @return - */ - @RequestMapping("tamplate") - public JSONObject tamplate(){ - return monitorService.template(); - - } - //查询视频点播巡检结果,只取异常的 // @RequestMapping("listChannelPlayStates") // public Result listChannelPlayStates( diff --git a/src/main/java/com/hisense/monitormanage/controller/ShangTangController.java b/src/main/java/com/hisense/monitormanage/controller/ShangTangController.java new file mode 100644 index 0000000..2d330ab --- /dev/null +++ b/src/main/java/com/hisense/monitormanage/controller/ShangTangController.java @@ -0,0 +1,68 @@ +package com.hisense.monitormanage.controller; + +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hisense.monitormanage.entity.Result; +import com.hisense.monitormanage.service.ShangTangService; +import org.omg.CORBA.Request; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("STapi/project") +public class ShangTangController { + + @Autowired + private ShangTangService shangTangService; + + /** + * 订阅任务下发接口 + * @return + */ + @RequestMapping("subscribe") + public JSONObject subscribe(){ + return shangTangService.subscribe(); + } + + /** + * 订阅任务下发接口 + * @param request + * @return + * @throws IOException + */ + @RequestMapping("receive") + public Result receive(HttpServletRequest request) throws IOException { + ServletInputStream ris = request.getInputStream(); + StringBuilder content = new StringBuilder(); + byte[] b = new byte[1024]; + int lens = -1; + while ((lens = ris.read(b)) > 0) { + content.append(new String(b, 0, lens)); + } + String strcont = content.toString();// 内容 + + System.out.println(strcont); + return Result.success(strcont); + } + + + /** + * 事件模板分页查询接口 + * @return + */ + @RequestMapping("tamplate") + public JSONObject tamplate(){ + return shangTangService.template(); + + } + +} diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index 4bed49d..78f1fb6 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -455,77 +455,6 @@ public class MonitorService { } } - //1.登录 - //2.获取token - public String shangtangToken () { - String url = "http://10.132.191.54:10270/whale-open-api/tenant/token"; - - Map map = new HashMap<>(); - map.put("ksUserName","hisense"); - map.put("ksUserPassWord","Admin@2022"); - ResponseEntity responseEntity; - try { - responseEntity = restTemplate.postForEntity(url,map,JSONObject.class); - JSONObject body = responseEntity.getBody(); - JSONObject data = body.getJSONObject("data"); - String token = data.getString("token"); - return token; - } catch (Exception e) { - log.info("[shangtangToken] exception:{}", e.getMessage()); - return null; - } - } - - //订阅任务下发接口 - public JSONObject subscribe(){ - String token = this.shangtangToken(); - String url = "http://10.132.191.54:10270/whale-open-api/subscribe"; - - HttpHeaders headers = new HttpHeaders(); - - headers.add("token", token); - headers.add("tid","default"); - - Map map = new HashMap<>(); - map.put("callBackUrl","http://15.2.23.205:7009/api/project/subscribe"); -// map.put("certPubKey",""); - map.put("subscribeType",1); -// map.put("taskId","serial"); - - ResponseEntity responseEntity; - try { - responseEntity = restTemplate.exchange(url,HttpMethod.POST,new HttpEntity<>(map,headers),JSONObject.class); - JSONObject body = responseEntity.getBody(); - return body; - }catch (Exception e){ - log.info( "[subscribe] exception:{}",e.getMessage()); - return null; - } - - } - - //事件模板分页查询接口 - public JSONObject template(){ - //String token = this.shangtangToken(); - String url = "http://10.132.191.54:10270/whale-open-api/scenario/event/template?pageNum=1&pageSize=1000"; - - HttpHeaders headers = new HttpHeaders(); - headers.add("token","506eaf5d5d4a4cddb18f0370d906e22f"); - headers.add("tid","default"); - - ResponseEntity responseEntity; - try { - responseEntity = restTemplate.exchange(url,HttpMethod.GET,new HttpEntity<>(headers),JSONObject.class); - JSONObject jsonObject = responseEntity.getBody(); - return jsonObject; - } catch (Exception e) { - log.info("[template] exception:{}", e.getMessage()); - return null; - } - - } - - //查询视频点播巡检结果 @Scheduled(cron="0 5 6 * * ?") public Result listChannelPlayStates(){ diff --git a/src/main/java/com/hisense/monitormanage/service/ShangTangService.java b/src/main/java/com/hisense/monitormanage/service/ShangTangService.java new file mode 100644 index 0000000..de9a873 --- /dev/null +++ b/src/main/java/com/hisense/monitormanage/service/ShangTangService.java @@ -0,0 +1,93 @@ +package com.hisense.monitormanage.service; + +import com.alibaba.fastjson.JSONObject; +import lombok.extern.log4j.Log4j2; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.*; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +import java.util.HashMap; +import java.util.Map; + +@Service +@Log4j2 +public class ShangTangService { + + @Autowired + private RestTemplate restTemplate; + + //1.登录 + //2.获取token + public String shangtangToken () { + String url = "http://10.132.191.54:10270/whale-open-api/tenant/token"; + + Map map = new HashMap<>(); + map.put("accessKey","a1ddCV7z7Jhv0SBGx5O3hblO"); + map.put("secretKey","glIixzORLgoFJz0VdF1aXICR"); + ResponseEntity responseEntity; + try { + responseEntity = restTemplate.postForEntity(url,map,JSONObject.class); + JSONObject body = responseEntity.getBody(); + JSONObject data = body.getJSONObject("data"); + String token = data.getString("token"); + log.info("get token:{}", body.toJSONString()); + return token; + } catch (Exception e) { + log.info("[shangtangToken] exception:{}", e.getMessage()); + return null; + } + } + + //订阅任务下发接口 + public JSONObject subscribe(){ + String token = this.shangtangToken(); + String url = "http://10.132.191.54:10270/whale-open-api/subscribe"; + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + headers.add("token", token); + headers.add("tid","default"); + + Map map = new HashMap<>(); + map.put("callBackUrl","http://15.2.23.205:7009/STapi/project/receive"); +// map.put("certPubKey",""); + map.put("subscribeType",3); +// map.put("taskId","serial"); + + ResponseEntity responseEntity; + HttpEntity entity = new HttpEntity<>(JSONObject.toJSONString(map), headers); + try { + responseEntity = restTemplate.exchange(url, HttpMethod.POST,entity,JSONObject.class); + JSONObject body = responseEntity.getBody(); + return body; + }catch (Exception e){ + log.info( "[subscribe] exception:{}",e.getMessage()); + return null; + } + + } + + //事件模板分页查询接口 + public JSONObject template(){ + String token = this.shangtangToken(); + String url = "http://10.132.191.54:10270/whale-open-api/scenario/event/template?pageNum=1&pageSize=1000"; + + HttpHeaders headers = new HttpHeaders(); + headers.add("token",token); + headers.add("tid","default"); + + ResponseEntity responseEntity; + try { + responseEntity = restTemplate.exchange(url,HttpMethod.GET,new HttpEntity<>(headers),JSONObject.class); + JSONObject jsonObject = responseEntity.getBody(); + return jsonObject; + } catch (Exception e) { + log.info("[template] exception:{}", e.getMessage()); + return null; + } + + } + +} From 0f9588aa4c89ee239ae5d3151c0a1659358974b9 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Tue, 17 May 2022 13:40:02 +0800 Subject: [PATCH 2/3] 1 --- .../monitormanage/controller/Controller.java | 115 +++++++++++------- 1 file changed, 71 insertions(+), 44 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index a5a0131..53d84e4 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -5,7 +5,12 @@ import com.hisense.monitormanage.dto.*; import com.hisense.monitormanage.entity.*; import com.hisense.monitormanage.mapper.*; import com.hisense.monitormanage.service.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -15,6 +20,7 @@ import java.util.Map; @RestController @RequestMapping("api/project") +@Api(tags="通用") public class Controller { @Autowired @@ -259,27 +265,7 @@ public class Controller { return success; } - - /** - * 订阅任务下发接口 - * @return - */ - @RequestMapping("subscribe") - public JSONObject subscribe(){ - return monitorService.subscribe(); - } - - - /** - * 事件模板分页查询接口 - * @return - */ - @RequestMapping("tamplate") - public JSONObject tamplate(){ - return monitorService.template(); - - } - + //查询视频点播巡检结果,只取异常的 // @RequestMapping("listChannelPlayStates") // public Result listChannelPlayStates( @@ -290,55 +276,64 @@ public class Controller { // } //道路统计数据与排名 - @RequestMapping("roadData") + @GetMapping("roadData") + @ApiOperation("道路统计数据与排名,根据后台dt调用接口") public List roadData(){ return monitorService.roadData(); } //启迪中台 //登录 - @RequestMapping("qidiToken") + @GetMapping("qidiToken") + @ApiOperation("启迪数据中台登录获取token") public String qidiToken(){ return monitorService.qidiToken(); } //渣土车轨迹数据 - @RequestMapping("resCatalogApplyZTYS") + @GetMapping("resCatalogApplyZTYS") + @ApiOperation("获取渣土车轨迹数据,根据后台UPLOADTIME调用接口") public List resCatalogApply(){ return monitorService.resCatalogApplyZTYS(); } //环卫车轨迹数据 - @RequestMapping("resCatalogApplyHJWS") + @GetMapping("resCatalogApplyHJWS") + @ApiOperation("环卫车轨迹数据,根据后台updatetime调用接口") public List resCatalogApplyHJWS(){ return monitorService.resCatalogApplyHJWS(); } //工地信息 - @RequestMapping("resCatalogApplyGDYS") + @GetMapping("resCatalogApplyGDYS") + @ApiOperation("获取工地信息-表中获取") public List resCatalogApplyGDYS(){ return monitorService.resCatalogApplyGDYS(); } //环卫车辆数据1,基础 - @RequestMapping("resCatalogApplyHJWSBase") + @GetMapping("resCatalogApplyHJWSBase") + @ApiOperation("环卫车辆数据1,基础--根据后台updatetime调用接口") public List resCatalogApplyHJWSBase(){ return monitorService.resCatalogApplyHJWSBase(); } //环卫车辆数据1,作业 - @RequestMapping("resCatalogApplyHJWSZY") + @GetMapping("resCatalogApplyHJWSZY") + @ApiOperation("环卫车辆数据1,作业--根据后台ZYRQ调用接口") public List resCatalogApplyHJWSZY(){ return monitorService.resCatalogApplyHJWSZY(); } //环卫道路明细数据 - @RequestMapping("resCatalogApplyHJWSRoad") + @GetMapping("resCatalogApplyHJWSRoad") + @ApiOperation("环卫道路明细数据,根据后台updatetime调用接口") public List resCatalogApplyHJWSRoad(){ return monitorService.resCatalogApplyHJWSRoad(); } //获取渣土车轨迹并保存到t_trail_sediment - @RequestMapping(value = "saveResCatalogApplyZTYS") + @GetMapping(value = "saveResCatalogApplyZTYS") + @ApiOperation("取渣土车轨迹并保存到t_trail_sediment,根据后台UPLOADTIME调用接口") public Result resCatalogApplyZTYS(){ boolean result = sedimentTrailService.batchSaveSedimentTrail(); @@ -350,7 +345,15 @@ public class Controller { } //根据输入的经纬度和查询的半径(米)时间查询范围内的渣土车轨迹信息 - @RequestMapping(value = "listSedimentTrailByPoints") + @GetMapping(value = "listSedimentTrailByPoints") + @ApiOperation("渣土车轨迹信息,根据经纬度和半径从表中查询") + @ApiImplicitParams({ + @ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = true,dataType ="double"), + @ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = true,dataType ="double"), + @ApiImplicitParam(name = "raidus", value = "半径,米", paramType = "query",required = true,dataType ="Integer"), + @ApiImplicitParam(name = "start", value = "开始时间,2021-08-03 10:17:23", paramType = "query",required = true,dataType ="string"), + @ApiImplicitParam(name = "end", value = "结束时间,2021-08-03 12:17:23", paramType = "query",required = true,dataType ="string") + }) public Result listSedimentTrailByPoints( @RequestParam(value="longitude") double longitude, @RequestParam(value="latitude") double latitude, @@ -358,27 +361,29 @@ public class Controller { @RequestParam(value="start") String start, @RequestParam(value = "end") String end ){ - System.out.println("listSedimentTrailByPoints......"); Map> map = sedimentTrailService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end); return Result.success(map); } - @RequestMapping("passengerFlow") //测试获取最新的客流列表,从接口获取 + @GetMapping("passengerFlow") + @ApiOperation("获取最新的客流列表,测试接口,调用接口获取") public List passengerFlow(){ List list = passengerFlowService.passengerFlow(); return list; } + //获取最新的实时客流列表,从表获取 - @RequestMapping("listPassengerFlow") + @GetMapping("listPassengerFlow") + @ApiOperation("获取最新的实时客流列表,从表获取,热力图") public List listPassengerFlow(){ List list = passengerFlowService.listPassengerFlow(); return list; } - //获取实时客流并保存到表t_passenger_flow - @RequestMapping("savePassengerFlow") + @GetMapping("savePassengerFlow") + @ApiOperation("获取实时客流并保存到表t_passenger_flow,调用接口") public Result savePassengerFlow(){ List list = passengerFlowService.passengerFlow(); boolean result = passengerFlowService.savePassengerFlow(list); @@ -389,8 +394,15 @@ public class Controller { } } - //根据输入的经纬度和查询的半径(米)和hourId查询游客总数 - @RequestMapping("getPassengerNum") + //根据输入的经纬度和查询的半径(米)和timeId查询游客总数 + @GetMapping("getPassengerNum") + @ApiOperation("查询游客总数,根据经纬度和半径米、timeId从表中查询") + @ApiImplicitParams({ + @ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = true,dataType ="double"), + @ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = true,dataType ="double"), + @ApiImplicitParam(name = "raidus", value = "半径,米", paramType = "query",required = true,dataType ="Integer"), + @ApiImplicitParam(name = "timeId", value = "时间点,202205101600", paramType = "query",required = true,dataType ="string"), + }) public Result getPassengerNum( @RequestParam(value="longitude") double longitude, @RequestParam(value="latitude") double latitude, @@ -401,7 +413,8 @@ public class Controller { } //查询并保存环卫车轨迹到表t_trail_sanitation - @RequestMapping("saveTrailSanitation") + @GetMapping("saveTrailSanitation") + @ApiOperation("保存环卫车轨迹到表t_trail_sanitation,根据后台updatetime调用接口") public Result saveTrailSanitation(){ boolean result = trailSanitationService.saveTrailSanitation(); if(result){ @@ -412,7 +425,15 @@ public class Controller { } //根据输入的经纬度和查询的半径(米)时间查询范围内的环卫车轨迹信息 - @RequestMapping(value = "listTrailSanitationByPoints") + @GetMapping(value = "listTrailSanitationByPoints") + @ApiOperation("查询范围内环卫车轨迹信息,根据经纬度、半径米,时间从表中查询") + @ApiImplicitParams({ + @ApiImplicitParam(name = "longitude", value = "经度", paramType = "query",required = true,dataType ="double"), + @ApiImplicitParam(name = "latitude", value = "纬度", paramType = "query",required = true,dataType ="double"), + @ApiImplicitParam(name = "raidus", value = "半径,米", paramType = "query",required = true,dataType ="Integer"), + @ApiImplicitParam(name = "start", value = "开始时间,2021-03-17 00:00:00", paramType = "query",required = true,dataType ="string"), + @ApiImplicitParam(name = "end", value = "结束时间,2021-03-22 00:00:00", paramType = "query",required = true,dataType ="string"), + }) public Result listTrailSanitationByPoints( @RequestParam(value="longitude") double longitude, @RequestParam(value="latitude") double latitude, @@ -420,23 +441,29 @@ public class Controller { @RequestParam(value="start") String start, @RequestParam(value = "end") String end ){ -// System.out.println("listTrailSanitationByPoints......"); List list = trailSanitationService.listSedimentTrailByPoints(longitude,latitude,raidus,start,end); return Result.success(list); } + //查询道路污染数据 - @RequestMapping(value="listRoadData") //输入参考:2022-05-10 00:00:00,只能查询当前日期前一天及以前的 + @GetMapping(value="listRoadData") + @ApiOperation("查询道路污染数据,根据dt从表中查询,参考输入-2022-05-10 00:00:00,只能查询当前日期前一天及以前的") + @ApiImplicitParam(name="dt",value = "时间",paramType = "query",required = true,dataType = "string") public Result listRoadData(@RequestParam(value="dt") String dt){ List list = roadDataService.listRoadData(dt); return Result.success(list); } //查询工地信息,根据经纬度和半径查询 - @RequestMapping(value = "listBuildingSiteByPoints") + @GetMapping(value = "listBuildingSiteByPoints") + @ApiOperation("查询工地信息,根据经纬度和半径从表中查询") + @ApiImplicitParams({ + @ApiImplicitParam(name="longitude",value = "经度",paramType = "query",required = true,dataType = "double"), + @ApiImplicitParam(name="longitude",value = "经度",paramType = "query",required = true,dataType = "double") + }) public Result listBuildingSiteByPoints(double longitude,double latitude,Integer raidus){ List list = new ArrayList<>(); - list = buildingSitrService.listBuildingSiteByPoints(longitude,latitude,raidus); return Result.success(list); } From 0cacf6c8fa09475eeaedadfa622b20677df708b9 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Tue, 17 May 2022 13:59:19 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0swagger=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/Controller.java | 39 ++++++++++++------- .../controller/ShangTangController.java | 3 ++ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index 53d84e4..2c5bc52 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -122,11 +122,10 @@ public class Controller { * @param * @return */ - @RequestMapping("selectAll") + @GetMapping("selectAll") + @ApiOperation("查询所有摄像头") public String selectAll(){ - return cameraChannelService.selectAll(); - } /** @@ -134,7 +133,9 @@ public class Controller { * @param channelCode * @return */ - @RequestMapping("selectByChannelCode") + @GetMapping("selectByChannelCode") + @ApiOperation("根据channelCode查询摄像头详细信息") + @ApiImplicitParam(name = "channelCode",value = "摄像头标识",required = true,dataType = "String") public Result selectByChannelCode(String channelCode){ List list = cameraChannelMapper.selectByChannelCode(channelCode); @@ -151,7 +152,9 @@ public class Controller { * @param channelName * @return */ - @RequestMapping("selectByChannelName") + @GetMapping("selectByChannelName") + @ApiOperation("根据摄像头名字模糊查询摄像头") + @ApiImplicitParam(name = "channelName",value = "摄像头名称",required = true,dataType = "String") public Result selectByChannelName(String channelName){ List labels = cameraChannelMapper.selectByChannelName(channelName); @@ -162,11 +165,16 @@ public class Controller { } /** - * 根据parentId查询摄像头 + * 根据parentId和checkStatus查询摄像头 * @param parentId * @return */ - @RequestMapping("selectByParentId") + @GetMapping("selectByParentId") + @ApiOperation("根据parentId和checkStatus查询摄像头") + @ApiImplicitParams({ + @ApiImplicitParam(name = "parentId",value = "摄像头的组织Id",required = true,dataType = "String"), + @ApiImplicitParam(name = "checkStatus",value = "异常状态 1正常,0异常",required = true,dataType = "String") + }) public Result selectByParentId(String parentId,String checkStatus){ List list = cameraChannelMapper.selectByParentId(parentId,checkStatus); @@ -181,7 +189,9 @@ public class Controller { * 根据标签查询对应摄像头 * @return */ - @RequestMapping("selectLabel") + @GetMapping("selectLabel") + @ApiOperation("根据标签查询对应摄像头") + @ApiImplicitParam(name = "labelCode",value = "标签号",required = true,dataType = "String") public Result selectLabel(String labelCode){ List channelLabelDtos = cameraChannelMapper.selectLabel(labelCode); @@ -205,7 +215,7 @@ public class Controller { * @param gpsY1 * @return */ - @RequestMapping("selectAllByGps") + @GetMapping ("selectAllByGps") public Result selectAllByGps(String gpsX,String gpsX1,String gpsY,String gpsY1){ List gps = cameraChannelMapper.selectAllByGps(gpsX, gpsX1, gpsY, gpsY1); @@ -224,7 +234,8 @@ public class Controller { * @param label * @return */ - @RequestMapping("selectAllLabel") + @GetMapping("selectAllLabel") + @ApiOperation("查询所有标签") public Result selectAllLabel(Label label ){ List