zhanghua
2022-11-04 9eba8d0c7cbadb31c40e0fe1536b01d5392f1665
驾驶舱接口修改
5个文件已修改
1个文件已添加
146 ■■■■ 已修改文件
document/驾驶舱数据接口文档(ai物联和综合决策).docx 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/vo/cockpit/CockpitVO.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/util/CheckApiUtil.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
document/¼ÝÊ»²ÕÊý¾Ý½Ó¿ÚÎĵµ£¨aiÎïÁªºÍ×ۺϾö²ß£©.docx
Binary files differ
ycl-common/src/main/java/com/ycl/vo/cockpit/CockpitVO.java
@@ -12,38 +12,43 @@
 * @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;
    }
//    }
}
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java
@@ -34,8 +34,8 @@
    @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);
@@ -47,9 +47,8 @@
    @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++) {
@@ -69,8 +68,8 @@
    @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++) {
@@ -85,8 +84,8 @@
    @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);
@@ -95,8 +94,8 @@
    @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;
ycl-platform/src/main/java/com/ycl/controller/cockpit/enforcementEvents/EnforcementEventsController.java
@@ -33,8 +33,8 @@
    @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);
@@ -48,8 +48,8 @@
    @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;
@@ -67,8 +67,8 @@
    @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++) {
@@ -83,8 +83,8 @@
    @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;
@@ -102,8 +102,8 @@
    @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++) {
@@ -117,8 +117,8 @@
    @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++) {
@@ -133,8 +133,8 @@
    @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);
ycl-platform/src/main/java/com/ycl/controller/cockpit/statisticsEvents/StatisticsEventsController.java
@@ -33,8 +33,8 @@
    @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++) {
@@ -50,8 +50,8 @@
    @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++) {
@@ -67,8 +67,8 @@
    @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);
@@ -81,8 +81,8 @@
    @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++) {
@@ -97,8 +97,8 @@
    @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);
ycl-platform/src/main/java/com/ycl/util/CheckApiUtil.java
@@ -4,6 +4,7 @@
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;
@@ -23,28 +24,27 @@
    /**
     * é©¾é©¶èˆ±
     *
     * @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);
        }
    }