|
@@ -52,7 +52,7 @@ public class ConfigCtrl {
|
|
|
@RequestMapping("/saveConfig")
|
|
|
public ResponseBodyVO<ConfigPO> saveConfig(@RequestBody ConfigVO configVO) {
|
|
|
if (ObjectUtil.isNull(configVO)) {
|
|
|
- return new ResponseBodyVO(false, 500, "参数必传!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "参数必传!", null);
|
|
|
}
|
|
|
//端口重复校验
|
|
|
Map<String, List<ConfigSensorVO>> configSensors = configVO.getConfigSensors();
|
|
@@ -61,14 +61,14 @@ public class ConfigCtrl {
|
|
|
if (ObjectUtil.isNotNull(configSensorVOS)) {
|
|
|
long count = configSensorVOS.stream().mapToInt(ConfigSensorVO::getSensorPort).distinct().count();
|
|
|
if (configSensorVOS.size() != count) {
|
|
|
- return new ResponseBodyVO(false, 500, "端口重复!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "端口重复!", null);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- ResponseBodyVO<ConfigPO> response = new ResponseBodyVO<ConfigPO>(ResponseBodyVO.Response.SUCCESS);
|
|
|
+ ResponseBodyVO<ConfigPO> response = new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
|
|
|
ConfigPO po = configService.saveConfig(configVO);
|
|
|
if (ObjectUtil.isNull(po.getId())) {
|
|
|
- return new ResponseBodyVO(false, 500, "配置名称重复!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "配置名称重复!", null);
|
|
|
}
|
|
|
response.setInfo(po);
|
|
|
return response;
|
|
@@ -80,7 +80,7 @@ public class ConfigCtrl {
|
|
|
@RequestMapping("/saveAnotherConfig")
|
|
|
public ResponseBodyVO<ConfigPO> saveAnotherConfig(@RequestBody ConfigVO configVO) {
|
|
|
if (ObjectUtil.isNull(configVO)) {
|
|
|
- return new ResponseBodyVO(false, 500, "参数必传!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "参数必传!", null);
|
|
|
}
|
|
|
//端口重复校验
|
|
|
Map<String, List<ConfigSensorVO>> configSensors = configVO.getConfigSensors();
|
|
@@ -89,14 +89,14 @@ public class ConfigCtrl {
|
|
|
if (ObjectUtil.isNotNull(configSensorVOS)) {
|
|
|
long count = configSensorVOS.stream().mapToInt(ConfigSensorVO::getSensorPort).distinct().count();
|
|
|
if (configSensorVOS.size() != count) {
|
|
|
- return new ResponseBodyVO(false, 500, "端口重复!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "端口重复!", null);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
ResponseBodyVO<ConfigPO> response = new ResponseBodyVO<ConfigPO>(ResponseBodyVO.Response.SUCCESS);
|
|
|
ConfigPO po = configService.saveAnotherConfig(configVO);
|
|
|
if (ObjectUtil.isNull(po.getId())) {
|
|
|
- return new ResponseBodyVO(false, 500, "配置名称重复!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "配置名称重复!", null);
|
|
|
}
|
|
|
response.setInfo(po);
|
|
|
return response;
|
|
@@ -109,12 +109,12 @@ public class ConfigCtrl {
|
|
|
@PreAuthorize("@AuthorityCheck.admin()")
|
|
|
public ResponseBodyVO<ConfigPO> shareConfigByInfo(@RequestBody ConfigVO configVO) {
|
|
|
if (ObjectUtil.isNull(configVO)) {
|
|
|
- return new ResponseBodyVO(false, 500, "参数必传!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "参数必传!", null);
|
|
|
}
|
|
|
ResponseBodyVO<ConfigPO> response = new ResponseBodyVO<ConfigPO>(ResponseBodyVO.Response.SUCCESS);
|
|
|
ConfigPO po = configService.shareConfigByInfo(configVO);
|
|
|
if (ObjectUtil.isNull(po.getId())) {
|
|
|
- return new ResponseBodyVO(false, 500, "配置名称重复!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "配置名称重复!", null);
|
|
|
}
|
|
|
response.setInfo(po);
|
|
|
return response;
|
|
@@ -142,12 +142,12 @@ public class ConfigCtrl {
|
|
|
* 删除
|
|
|
*/
|
|
|
@RequestMapping("/delConfigById")
|
|
|
- public ResponseBodyVO delConfigById(@RequestBody ConfigVO configVO) {
|
|
|
+ public ResponseBodyVO<String> delConfigById(@RequestBody ConfigVO configVO) {
|
|
|
int i = configService.delConfigById(configVO);
|
|
|
if (i > 0) {
|
|
|
- return new ResponseBodyVO(ResponseBodyVO.Response.SUCCESS);
|
|
|
+ return new ResponseBodyVO<>(ResponseBodyVO.Response.SUCCESS);
|
|
|
} else {
|
|
|
- return new ResponseBodyVO(false, 500, "删除失败!", null);
|
|
|
+ return new ResponseBodyVO<>(false, 500, "删除失败!", null);
|
|
|
}
|
|
|
}
|
|
|
}
|