From 6113331f380808b93d757cfeebfc3f2ffa34e34b Mon Sep 17 00:00:00 2001 From: liyanqi <15181887205@163.com> Date: 星期一, 31 十月 2022 15:51:36 +0800 Subject: [PATCH] 驾驶舱接口校验补充 --- ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java b/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java index 343aa77..1c19a87 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java @@ -1,6 +1,7 @@ package com.ycl.controller.cockpit.enforcementEvents; import com.ycl.api.CommonResult; +import com.ycl.util.CheckApiUtil; import com.ycl.vo.cockpit.CockpitVO; import com.ycl.vo.cockpit.enforcementEvents.EnforcementEventsVO; import io.swagger.annotations.Api; @@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.ArrayList; @@ -26,16 +28,20 @@ @RestController @RequestMapping("/api/event") public class EnforcementEventsController { + @Resource + private CheckApiUtil checkApiUtil; + @ApiOperation(value = "鎵ф硶浜嬩欢缁熻") @GetMapping("/statistics") public CommonResult<Map<String, Object>> statistics(@Validated CockpitVO.Params2VO params) { + checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime()); Map<String, Object> map = new HashMap<>(); EnforcementEventsVO.StatisticsEventVO eventVO = new EnforcementEventsVO.StatisticsEventVO(); eventVO.setCount(10); eventVO.setRatio(new BigDecimal("0.69").setScale(2, RoundingMode.HALF_UP)); map.put("reported", eventVO); map.put("disposition", eventVO); - map.put("dispositionInTime",eventVO); + map.put("dispositionInTime", eventVO); map.put("register", eventVO); return CommonResult.success(map); } @@ -43,6 +49,7 @@ @ApiOperation(value = "浜嬩欢绫诲瀷") @GetMapping("/type") public CommonResult<EnforcementEventsVO.TypeAndSourceVO> type(@Validated CockpitVO.Params2VO params) { + checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime()); List<EnforcementEventsVO.TypeAndSourceVO1> typeVO1s = new ArrayList<>(); EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO(); EnforcementEventsVO.TypeAndSourceVO1 typeVO1 = null; @@ -61,6 +68,7 @@ @ApiOperation(value = "瑙嗛鎶撴媿鍛婂彂鐐逛綅") @GetMapping("/video") public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> video(@Validated CockpitVO.Params2VO params) { + checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime()); List<EnforcementEventsVO.VideoAndAreaVO> videoVOS = new ArrayList<>(); EnforcementEventsVO.VideoAndAreaVO videoVO = null; for (int i = 0; i < 4; i++) { @@ -75,6 +83,7 @@ @ApiOperation(value = "浜嬩欢鏉ユ簮") @GetMapping("/source") public CommonResult<EnforcementEventsVO.TypeAndSourceVO> source(@Validated CockpitVO.Params2VO params) { + checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime()); List<EnforcementEventsVO.TypeAndSourceVO1> typeVO1s = new ArrayList<>(); EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO(); EnforcementEventsVO.TypeAndSourceVO1 typeVO1 = null; @@ -93,6 +102,7 @@ @ApiOperation(value = "浜嬩欢鍖哄煙缁熻") @GetMapping("/area") public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> area(@Validated CockpitVO.Params2VO params) { + checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime()); List<EnforcementEventsVO.VideoAndAreaVO> videoVOS = new ArrayList<>(); EnforcementEventsVO.VideoAndAreaVO videoVO = null; for (int i = 0; i < 4; i++) { @@ -107,6 +117,7 @@ @ApiOperation(value = "寤惰浜嬩欢") @GetMapping("/delay") public CommonResult<List<EnforcementEventsVO.DelayVO>> delay(@Validated CockpitVO.Params2VO params) { + checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime()); List<EnforcementEventsVO.DelayVO> delayVOS = new ArrayList<>(); EnforcementEventsVO.DelayVO delayVO = null; for (int i = 0; i < 4; i++) { @@ -122,6 +133,7 @@ @ApiOperation(value = "浜嬩欢淇℃伅") @GetMapping("/info") public CommonResult<EnforcementEventsVO.InfoVO> info(@Validated CockpitVO.Params2VO params) { + checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime()); EnforcementEventsVO.InfoVO infoVO = new EnforcementEventsVO.InfoVO(); EnforcementEventsVO.EventVO eventVO = new EnforcementEventsVO.EventVO(); infoVO.setToday(5); -- Gitblit v1.8.0