| | |
| | | * @version 1.0 |
| | | * @date 2022/10/26 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CockpitVO { |
| | | @Data |
| | | @ApiModel |
| | | public class Params1VO implements Serializable { |
| | | @ApiModelProperty(value = "appId", example = "1") |
| | | // @Data |
| | | // @ApiModel |
| | | // public class Params1VO implements Serializable { |
| | | // @ApiModelProperty(value = "appId", example = "1") |
| | | // @NotBlank(message = "appIdä¸è½ä¸ºç©º") |
| | | // private String appId; |
| | | // @ApiModelProperty(value = "appKey", example = "1") |
| | | // @NotBlank(message = "appKeyä¸è½ä¸ºç©º") |
| | | // private String appKey; |
| | | // @ApiModelProperty(value = "sign", example = "sfagjgfjgfjdgfjsgdfgsa") |
| | | // @NotBlank(message = "signä¸è½ä¸ºç©º") |
| | | // private String sign; |
| | | // } |
| | | // |
| | | // @Data |
| | | // @ApiModel |
| | | // public class Params2VO implements Serializable { |
| | | @ApiModelProperty(value = "appId", example = "1") |
| | | @NotBlank(message = "appIdä¸è½ä¸ºç©º") |
| | | private String appId; |
| | | @ApiModelProperty(value = "appKey", example = "1") |
| | | // @NotBlank(message = "appKeyä¸è½ä¸ºç©º") |
| | | @NotBlank(message = "appKeyä¸è½ä¸ºç©º") |
| | | private String appKey; |
| | | @ApiModelProperty(value = "sign", example = "sfagjgfjgfjdgfjsgdfgsa") |
| | | // @NotBlank(message = "signä¸è½ä¸ºç©º") |
| | | @NotBlank(message = "signä¸è½ä¸ºç©º") |
| | | private String sign; |
| | | } |
| | | |
| | | @Data |
| | | @ApiModel |
| | | public class Params2VO implements Serializable { |
| | | @ApiModelProperty(value = "appId", example = "1") |
| | | // @NotBlank(message = "appIdä¸è½ä¸ºç©º") |
| | | private String appId; |
| | | @ApiModelProperty(value = "appKey", example = "1") |
| | | // @NotBlank(message = "appKeyä¸è½ä¸ºç©º") |
| | | private String appKey; |
| | | @ApiModelProperty(value = "sign", example = "sfagjgfjgfjdgfjsgdfgsa") |
| | | // @NotBlank(message = "signä¸è½ä¸ºç©º") |
| | | private String sign; |
| | | @ApiModelProperty(value = "streetId", example = "25") |
| | | private Integer streetId; |
| | | @ApiModelProperty(value = "å¼å§æ¶é´ï¼æ ¼å¼yyyy-MM-dd hh:mm:ss", example = "2022-10-22 13:22:22") |
| | | // @NotBlank(message = "å¼å§æ¶é´ä¸è½ä¸ºç©º") |
| | | private String beginTime; |
| | | @ApiModelProperty(value = "ç»ææ¶é´ï¼æ ¼å¼yyyy-MM-dd hh:mm:ss", example = "2022-10-23 13:22:22") |
| | | // @NotBlank(message = "ç»ææ¶é´ä¸è½ä¸ºç©º") |
| | | private String endTime; |
| | | } |
| | | // } |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "çæµæ°æ®") |
| | | @GetMapping("/detection") |
| | | public CommonResult<AIIotVO.DetectionVO> detection(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null); |
| | | public CommonResult<AIIotVO.DetectionVO> detection(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | AIIotVO.DetectionVO detectionVO = new AIIotVO.DetectionVO(); |
| | | detectionVO.setVideo(121); |
| | | detectionVO.setIndividual(20); |
| | |
| | | |
| | | @ApiOperation(value = "宿¶è§é¢çæ§") |
| | | @GetMapping("/video") |
| | | @ApiImplicitParam(name = "regionId",value = "å°åºId",required = true,dataType = "String") |
| | | public CommonResult<List<AIIotVO.VideoVO>> video(@Validated CockpitVO.Params1VO params, @RequestParam(required = true)String regionId) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,regionId); |
| | | public CommonResult<List<AIIotVO.VideoVO>> video(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<AIIotVO.VideoVO> videoVOS = new ArrayList<>(); |
| | | AIIotVO.VideoVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @ApiOperation(value = "AIç®æ³æè½") |
| | | @GetMapping("/efficiency") |
| | | public CommonResult<List<AIIotVO.EfficiencyVO>> efficiency(@Validated CockpitVO.Params2VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null); |
| | | public CommonResult<List<AIIotVO.EfficiencyVO>> efficiency(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<AIIotVO.EfficiencyVO> efficiencyVOS = new ArrayList<>(); |
| | | AIIotVO.EfficiencyVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @ApiOperation(value = "渣åèå¨") |
| | | @GetMapping("/slag_car") |
| | | public CommonResult<AIIotVO.SlagCarVO> slagCar(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null,null); |
| | | public CommonResult<AIIotVO.SlagCarVO> slagCar(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | AIIotVO.SlagCarVO slagCarVO = new AIIotVO.SlagCarVO(); |
| | | slagCarVO.setCar(236); |
| | | slagCarVO.setTeam(20); |
| | |
| | | |
| | | @ApiOperation(value = "AIäºä»¶ç»è®¡") |
| | | @GetMapping("/event_statistics") |
| | | public CommonResult<List<AIIotVO.StatisticsVO>> statistics(@Validated CockpitVO.Params2VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(),null); |
| | | public CommonResult<List<AIIotVO.StatisticsVO>> statistics(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<AIIotVO.StatisticsVO> statisticsVOS = new ArrayList<>(); |
| | | List<AIIotVO.Statistics1VO> statistics1VOS = new ArrayList<>(); |
| | | AIIotVO.StatisticsVO a = null; |
| | |
| | | |
| | | @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(),null); |
| | | public CommonResult<Map<String, Object>> statistics(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | EnforcementEventsVO.StatisticsEventVO eventVO = new EnforcementEventsVO.StatisticsEventVO(); |
| | | eventVO.setCount(10); |
| | |
| | | |
| | | @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(),null); |
| | | public CommonResult<EnforcementEventsVO.TypeAndSourceVO> type(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<EnforcementEventsVO.TypeAndSourceVO1> typeVO1s = new ArrayList<>(); |
| | | EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO(); |
| | | EnforcementEventsVO.TypeAndSourceVO1 typeVO1 = null; |
| | |
| | | |
| | | @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(),null); |
| | | public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> video(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<EnforcementEventsVO.VideoAndAreaVO> videoVOS = new ArrayList<>(); |
| | | EnforcementEventsVO.VideoAndAreaVO videoVO = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @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(),null); |
| | | public CommonResult<EnforcementEventsVO.TypeAndSourceVO> source(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<EnforcementEventsVO.TypeAndSourceVO1> typeVO1s = new ArrayList<>(); |
| | | EnforcementEventsVO.TypeAndSourceVO typeVO = new EnforcementEventsVO.TypeAndSourceVO(); |
| | | EnforcementEventsVO.TypeAndSourceVO1 typeVO1 = null; |
| | |
| | | |
| | | @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(),null); |
| | | public CommonResult<List<EnforcementEventsVO.VideoAndAreaVO>> area(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<EnforcementEventsVO.VideoAndAreaVO> videoVOS = new ArrayList<>(); |
| | | EnforcementEventsVO.VideoAndAreaVO videoVO = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @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(),null); |
| | | public CommonResult<List<EnforcementEventsVO.DelayVO>> delay(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<EnforcementEventsVO.DelayVO> delayVOS = new ArrayList<>(); |
| | | EnforcementEventsVO.DelayVO delayVO = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @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(),null); |
| | | public CommonResult<EnforcementEventsVO.InfoVO> info(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | EnforcementEventsVO.InfoVO infoVO = new EnforcementEventsVO.InfoVO(); |
| | | EnforcementEventsVO.EventVO eventVO = new EnforcementEventsVO.EventVO(); |
| | | infoVO.setToday(5); |
| | |
| | | |
| | | @ApiOperation(value = "æ§æ³äºä»¶") |
| | | @GetMapping("/law_enforcement_event") |
| | | public CommonResult<List<StatisticsEventsVO.LawEnforcementEventVO>> detection(@Validated CockpitVO.Params2VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), params.getBeginTime(), params.getEndTime(), null); |
| | | public CommonResult<List<StatisticsEventsVO.LawEnforcementEventVO>> detection(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<StatisticsEventsVO.LawEnforcementEventVO> lawEnforcementEventVOS = new ArrayList<>(); |
| | | StatisticsEventsVO.LawEnforcementEventVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @ApiOperation(value = "ç©èæç¥") |
| | | @GetMapping("/lot") |
| | | public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null, null); |
| | | public CommonResult<List<StatisticsEventsVO.LotVO>> lot(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<StatisticsEventsVO.LotVO> lotVOS = new ArrayList<>(); |
| | | StatisticsEventsVO.LotVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @ApiOperation(value = "æ§æ³éä¼") |
| | | @GetMapping("/team") |
| | | public CommonResult<StatisticsEventsVO.TeamVO> team(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null, null); |
| | | public CommonResult<StatisticsEventsVO.TeamVO> team(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | StatisticsEventsVO.TeamVO teamVO = new StatisticsEventsVO.TeamVO(); |
| | | teamVO.setAll(30); |
| | | teamVO.setAssistant(10); |
| | |
| | | |
| | | @ApiOperation(value = "ç½æ ¼å") |
| | | @GetMapping("/grid_member") |
| | | public CommonResult<List<StatisticsEventsVO.GridMemberVO>> gridMember(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null, null); |
| | | public CommonResult<List<StatisticsEventsVO.GridMemberVO>> gridMember(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | List<StatisticsEventsVO.GridMemberVO> gridMemberVOS = new ArrayList<>(); |
| | | StatisticsEventsVO.GridMemberVO a = null; |
| | | for (int i = 0; i < 4; i++) { |
| | |
| | | |
| | | @ApiOperation(value = "ææ°ä½å¾") |
| | | @GetMapping("/index_signs") |
| | | public CommonResult<StatisticsEventsVO.IndexSignsVO> indexSigns(@Validated CockpitVO.Params1VO params) { |
| | | checkApiUtil.cockpit(params.getAppId(), params.getAppKey(), params.getSign(), null, null, null); |
| | | public CommonResult<StatisticsEventsVO.IndexSignsVO> indexSigns(@Validated CockpitVO params) { |
| | | checkApiUtil.cockpit(params); |
| | | StatisticsEventsVO.IndexSignsVO indexSignsVO = new StatisticsEventsVO.IndexSignsVO(); |
| | | indexSignsVO.setEvent(1); |
| | | indexSignsVO.setGridMember(20); |
| | |
| | | import com.ycl.exception.ApiException; |
| | | import com.ycl.service.apiKey.IApiKeyService; |
| | | import com.ycl.utils.MD5Util; |
| | | import com.ycl.vo.cockpit.CockpitVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | /** |
| | | * é©¾é©¶è± |
| | | * |
| | | * @param appId appId |
| | | * @param appKey appKey |
| | | * @param sign sign |
| | | * @param beginTime å¼å§æ¶é´ |
| | | * @param endTime ç»ææ¶é´ |
| | | * @param regionId åºåId |
| | | * @param params |
| | | */ |
| | | public void cockpit(String appId, String appKey, String sign, String beginTime, String endTime, String regionId) { |
| | | apiKeyService.checkIsExist(appId, appKey, "驾驶ä»"); |
| | | public void cockpit(CockpitVO params) { |
| | | apiKeyService.checkIsExist(params.getAppId(), params.getAppKey(), "驾驶ä»"); |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append(appId); |
| | | sb.append(appKey); |
| | | sb.append("appId="); |
| | | sb.append(params.getAppId()); |
| | | sb.append("&appKey="); |
| | | sb.append(params.getAppKey()); |
| | | String result; |
| | | if (!StringUtils.isBlank(beginTime) && !StringUtils.isBlank(endTime)) { |
| | | sb.append(beginTime); |
| | | sb.append(endTime); |
| | | if (!StringUtils.isBlank(params.getBeginTime()) && !StringUtils.isBlank(params.getEndTime())) { |
| | | sb.append("&beginTime="); |
| | | sb.append(params.getBeginTime()); |
| | | sb.append("&endTime="); |
| | | sb.append(params.getEndTime()); |
| | | } |
| | | if (!StringUtils.isBlank(regionId)) { |
| | | sb.append(regionId); |
| | | if (params.getStreetId() != null) { |
| | | sb.append(params.getStreetId()); |
| | | } |
| | | result = MD5Util.md5Encrypt32Lower(sb.toString()); |
| | | if (!sign.equals(result)) { |
| | | if (!params.getSign().equals(result)) { |
| | | throw new ApiException(ResultCode.SIGN_ERROR); |
| | | } |
| | | } |