Browse Source

添加返回类

gao.qiang 1 year ago
parent
commit
4bf7eb6780

+ 89 - 164
vehicle-sdk/src/main/java/com/ozs/controller/upload/GeoHazardMonitorTokenController.java

@@ -978,23 +978,19 @@ public class GeoHazardMonitorTokenController {
         String token = apiTokenUtils.getGeoHazardMonitorToken(request);
         log.info("token:{}", token);
         log.info("parameter:{}", parameterVo);
-        JSONObject jsonObject = new JSONObject();
+        AjaxResult ajaxResult1 = null;
         if (StringUtils.isNotEmpty(token)) {
             String[] split = token.split("-");
             String key = split[split.length - 1];
             if (ObjectUtils.isEmpty(parameterVo)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "parameterVo参数不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "parameterVo参数不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
             CameraPlayVo cameraPlayVo = JSON.parseObject(s, CameraPlayVo.class);
             if (ObjectUtils.isEmpty(cameraPlayVo.getCameraCode())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "相机编码不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "相机编码不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             LambdaQueryWrapper<BaseCameraManagement> lw = new LambdaQueryWrapper<BaseCameraManagement>();
             lw.eq(BaseCameraManagement::getCameraCode, cameraPlayVo.getCameraCode());
@@ -1002,19 +998,14 @@ public class GeoHazardMonitorTokenController {
             lw.eq(BaseCameraManagement::getEnableOrNot, 1);
             BaseCameraManagement one = baseCameraManagementService.getOne(lw);
             if (ObjectUtils.isEmpty(one)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "没有该相机编码的相机或已离线");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
-            }
-            jsonObject.put("resultCode", 1);
-            jsonObject.put("message", "ok");
-            return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "没有该相机编码的相机或已离线");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
+            }
+            ajaxResult1 = new AjaxResult(1, "ok");
+            return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
         } else {
-            jsonObject.put("resultCode", 2);
-            jsonObject.put("message", "token验证失败");
-            jsonObject.put("data", "");
-            return JSONObject.toJSONString(jsonObject);
+            ajaxResult1 = new AjaxResult(2, "token验证失败");
+            return JSONObject.toJSONString(ajaxResult1);
         }
     }
 
@@ -1031,23 +1022,19 @@ public class GeoHazardMonitorTokenController {
         String token = apiTokenUtils.getGeoHazardMonitorToken(request);
         log.info("token:{}", token);
         log.info("parameter:{}", parameterVo);
-        JSONObject jsonObject = new JSONObject();
+        AjaxResult ajaxResult1 = null;
         if (StringUtils.isNotEmpty(token)) {
             String[] split = token.split("-");
             String key = split[split.length - 1];
             if (ObjectUtils.isEmpty(parameterVo)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "parameterVo参数不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "parameterVo参数不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
             CameraVo cameraVo = JSON.parseObject(s, CameraVo.class);
             if (ObjectUtils.isEmpty(cameraVo.getTerminalCode())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "车载终端编码不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "车载终端编码不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             LambdaQueryWrapper<MsgAlarm> wrapper = new LambdaQueryWrapper<>();
             if (!ObjectUtils.isEmpty(cameraVo.getRailwayCode())) {
@@ -1059,10 +1046,8 @@ public class GeoHazardMonitorTokenController {
             wrapper.orderByDesc(MsgAlarm::getAlarmTime);
             List<MsgAlarm> list = msgAlarmService.list(wrapper);
             if (list.size() <= 0) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "没有该报警线路或行别的报警信息");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "没有该报警线路或行别的报警信息");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             QueryAlarmVo queryAlarmVo = new QueryAlarmVo();
             List<RespAlarmList> listVos = new ArrayList<>();
@@ -1092,15 +1077,11 @@ public class GeoHazardMonitorTokenController {
             }
             RespAlarmList[] array = listVos.toArray(new RespAlarmList[]{});
             queryAlarmVo.setAlarmList(array);
-            jsonObject.put("resultCode", 1);
-            jsonObject.put("message", "ok");
-            jsonObject.put("data", queryAlarmVo);
-            return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+            ajaxResult1 = new AjaxResult(1, "ok",queryAlarmVo);
+            return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
         } else {
-            jsonObject.put("resultCode", 2);
-            jsonObject.put("message", "token验证失败");
-            jsonObject.put("data", "");
-            return JSONObject.toJSONString(jsonObject);
+            ajaxResult1 = new AjaxResult(2, "token验证失败");
+            return JSONObject.toJSONString(ajaxResult1);
         }
     }
 
@@ -1118,38 +1099,30 @@ public class GeoHazardMonitorTokenController {
         String token = apiTokenUtils.getGeoHazardMonitorToken(request);
         log.info("token:{}", token);
         log.info("parameter:{}", parameterVo);
-        JSONObject jsonObject = new JSONObject();
+        AjaxResult ajaxResult1 = null;
         if (StringUtils.isNotEmpty(token)) {
             String[] split = token.split("-");
             String key = split[split.length - 1];
             if (ObjectUtils.isEmpty(parameterVo)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "parameterVo参数不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "parameterVo参数不能为空",ajaxResult1);
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
             TerminalIgnoreVo terminalIgnoreVo = JSON.parseObject(s, TerminalIgnoreVo.class);
             if (ObjectUtils.isEmpty(terminalIgnoreVo.getTerminalCode())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "车载终端编码不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "车载终端编码不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             if (ObjectUtils.isEmpty(terminalIgnoreVo.getAlarmId())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "报警唯一UUID不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "报警唯一UUID不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             LambdaQueryWrapper<MsgAlarm> wrapper = new LambdaQueryWrapper<>();
             wrapper.eq(MsgAlarm::getAlarmId, terminalIgnoreVo.getAlarmId());
             MsgAlarm one = msgAlarmService.getOne(wrapper);
             if (ObjectUtils.isEmpty(one)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "没有该报警唯一UUID的报警数据");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "没有该报警唯一UUID的报警数据");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             } else {
                 if (ObjectUtils.isEmpty(one.getReleasedUrl())) {
                     //获取报警里程所监控的所有相机
@@ -1166,23 +1139,17 @@ public class GeoHazardMonitorTokenController {
                         one.setReleasedUrl(url);
                         msgAlarmService.updateById(one);
                     } else {
-                        jsonObject.put("resultCode", 0);
-                        jsonObject.put("message", "失败");
-                        jsonObject.put("data", "没有该报警里程位置的相机");
-                        return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                        ajaxResult1 = new AjaxResult(0, "没有该报警里程位置的相机");
+                        return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
                     }
                 }
             }
             map.put("url", one.getReleasedUrl());
-            jsonObject.put("resultCode", 1);
-            jsonObject.put("message", "ok");
-            jsonObject.put("data", map);
-            return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+            ajaxResult1 = new AjaxResult(1, "ok",map);
+            return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
         } else {
-            jsonObject.put("resultCode", 2);
-            jsonObject.put("message", "token验证失败");
-            jsonObject.put("data", "");
-            return JSONObject.toJSONString(jsonObject);
+            ajaxResult1 = new AjaxResult(2, "token验证失败");
+            return JSONObject.toJSONString(ajaxResult1);
         }
     }
 
@@ -1195,53 +1162,39 @@ public class GeoHazardMonitorTokenController {
         String token = apiTokenUtils.getGeoHazardMonitorToken(request);
         log.info("token:{}", token);
         log.info("parameter:{}", parameterVo);
-        JSONObject jsonObject = new JSONObject();
+        AjaxResult ajaxResult1 = null;
         if (StringUtils.isNotEmpty(token)) {
             String[] split = token.split("-");
             String key = split[split.length - 1];
             if (ObjectUtils.isEmpty(parameterVo)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "parameterVo参数不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "parameterVo参数不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
             SkynetHeartbeatVo skynetHeartbeatVo = JSON.parseObject(s, SkynetHeartbeatVo.class);
             if (ObjectUtils.isEmpty(skynetHeartbeatVo.getRailwayCode())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "线路编码不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "线路编码不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             if (ObjectUtils.isEmpty(skynetHeartbeatVo.getLineDir())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "行别不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "行别不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString("行别不能为空"), key);
             }
             if (skynetHeartbeatVo.getLineDir() != 1 && skynetHeartbeatVo.getLineDir() != 2) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "行别填写错误");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "行别填写错误");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             if (ObjectUtils.isEmpty(skynetHeartbeatVo.getInstallMile())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "安装里程位置不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "安装里程位置不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             if (!skynetHeartbeatVo.getInstallMile().toString().matches(PATTERNS)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "里程位置填写错误,只能填写数字");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "里程位置填写错误,只能填写数字");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             if (ObjectUtils.isEmpty(skynetHeartbeatVo.getCameraCode())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "相机编码不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "相机编码不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             SkynetHeartbeatLog skynetHeartbeatLog = new SkynetHeartbeatLog();
             skynetHeartbeatLog.setCameraCode(skynetHeartbeatVo.getCameraCode());
@@ -1251,21 +1204,15 @@ public class GeoHazardMonitorTokenController {
             if (synetHeartbeatLogMapper.insert(skynetHeartbeatLog) > 0) {
                 Map<String, Object> map = new HashMap<>();
                 map.put("cameraCode", skynetHeartbeatVo.getCameraCode());
-                jsonObject.put("resultCode", 1);
-                jsonObject.put("message", "ok");
-                jsonObject.put("data", map);
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(1, "ok",map);
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             } else {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "新增失败");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "新增失败");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
         } else {
-            jsonObject.put("resultCode", 2);
-            jsonObject.put("message", "token验证失败");
-            jsonObject.put("data", "");
-            return JSONObject.toJSONString(jsonObject);
+            ajaxResult1 = new AjaxResult(2, "token验证失败");
+            return JSONObject.toJSONString(ajaxResult1);
         }
     }
 
@@ -1277,29 +1224,23 @@ public class GeoHazardMonitorTokenController {
         String token = apiTokenUtils.getGeoHazardMonitorToken(request);
         log.info("token:{}", token);
         log.info("parameter:{}", parameterVo);
-        JSONObject jsonObject = new JSONObject();
+        AjaxResult ajaxResult1 = null;
         if (StringUtils.isNotEmpty(token)) {
             String[] split = token.split("-");
             String key = split[split.length - 1];
             if (ObjectUtils.isEmpty(parameterVo)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "parameterVo参数不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "parameterVo参数不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
             SvcAddress svcAddress = JSON.parseObject(s, SvcAddress.class);
             if (ObjectUtils.isEmpty(svcAddress.getGrantType())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "授权类型不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "授权类型不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             if (ObjectUtils.isEmpty(svcAddress.getClientId())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "客户端编号不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "客户端编号不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             AlarmHeartbeatLog alarmHeartbeatLog = new AlarmHeartbeatLog();
             alarmHeartbeatLog.setClientId(svcAddress.getClientId());
@@ -1307,21 +1248,15 @@ public class GeoHazardMonitorTokenController {
             if (alarmHeartbeatLogMapper.insert(alarmHeartbeatLog) > 0) {
                 Map<String, Object> map = new HashMap<>();
                 map.put("clientId", svcAddress.getClientId());
-                jsonObject.put("resultCode", 1);
-                jsonObject.put("message", "ok");
-                jsonObject.put("data", map);
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(1, "ok",map);
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             } else {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "新增失败");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "新增失败");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
         } else {
-            jsonObject.put("resultCode", 2);
-            jsonObject.put("message", "token验证失败");
-            jsonObject.put("data", "");
-            return JSONObject.toJSONString(jsonObject);
+            ajaxResult1 = new AjaxResult(2, "token验证失败");
+            return JSONObject.toJSONString(ajaxResult1);
         }
     }
 
@@ -1334,40 +1269,30 @@ public class GeoHazardMonitorTokenController {
         String token = apiTokenUtils.getGeoHazardMonitorToken(request);
         log.info("token:{}", token);
         log.info("parameterVo:{}", parameterVo);
-        JSONObject jsonObject = new JSONObject();
+        AjaxResult ajaxResult1 = null;
         if (StringUtils.isNotEmpty(token)) {
             String[] split = token.split("-");
             String key = split[split.length - 1];
             if (ObjectUtils.isEmpty(parameterVo)) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "parameterVo参数不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "parameterVo参数不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             String s = SM4Utils.decryptData_ECB(parameterVo.getParameter(), key);
             BaseTerminalLog baseTerminalLog = JSON.parseObject(s, BaseTerminalLog.class);
             if (ObjectUtils.isEmpty(baseTerminalLog.getTerminalCode())) {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "终端编码不能为空");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "终端编码不能为空");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
             if (baseTerminalLogService.save(baseTerminalLog)) {
-                jsonObject.put("resultCode", 1);
-                jsonObject.put("message", "ok");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(1, "ok");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             } else {
-                jsonObject.put("resultCode", 0);
-                jsonObject.put("message", "新增失败");
-                jsonObject.put("data", "");
-                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(jsonObject), key);
+                ajaxResult1 = new AjaxResult(0, "新增失败");
+                return SM4Utils.encryptData_ECB(JSONObject.toJSONString(ajaxResult1), key);
             }
         } else {
-            jsonObject.put("resultCode", 2);
-            jsonObject.put("message", "token验证失败");
-            jsonObject.put("data", "");
-            return JSONObject.toJSONString(jsonObject);
+            ajaxResult1 = new AjaxResult(2, "token验证失败");
+            return JSONObject.toJSONString(ajaxResult1);
         }
     }
 
@@ -1418,18 +1343,18 @@ public class GeoHazardMonitorTokenController {
      * @return
      */
     @PostMapping("/api/addRouteMassage")
-    public String addRouteMassage(@RequestBody BaseRouteMassage baseRouteMassage) {
+    public AjaxResult addRouteMassage(@RequestBody BaseRouteMassage baseRouteMassage) {
         if (!ObjectUtils.isEmpty(baseRouteMassage) && !ObjectUtils.isEmpty(baseRouteMassage.getStationCode())) {
             BaseRouteMassage one = baseRouteMassageService.getOne(new LambdaQueryWrapper<BaseRouteMassage>().eq(BaseRouteMassage::getStationCode, baseRouteMassage.getStationCode()));
             if (!ObjectUtils.isEmpty(one)) {
-                return "车站编码已存在!";
+                return AjaxResult.error("车站编码已存在!");
             }
         }
         baseRouteMassage.setCreateTime(new Date());
         baseRouteMassage.setStationName("博野站");
         baseRouteMassage.setMileagePosition(11111);
         baseRouteMassageService.save(baseRouteMassage);
-        return "200";
+        return AjaxResult.success();
     }
 
     /**
@@ -1453,12 +1378,12 @@ public class GeoHazardMonitorTokenController {
      * @return
      */
     @PostMapping("/api/deleteRouteMassage")
-    public String deleteRouteMassage(@RequestBody BaseRouteMassage baseRouteMassage) {
+    public AjaxResult deleteRouteMassage(@RequestBody BaseRouteMassage baseRouteMassage) {
         if (!ObjectUtils.isEmpty(baseRouteMassage) && !ObjectUtils.isEmpty(baseRouteMassage.getId())) {
             baseRouteMassageService.removeById(baseRouteMassage.getId());
-            return "200";
+            return AjaxResult.success();
         } else {
-            return "ID不存在";
+            return AjaxResult.error("ID不存在");
         }
     }