parent
e65f0e6ca4
commit
a17c589774
|
@ -10,7 +10,6 @@ import com.dispose.common.Helper;
|
||||||
import com.dispose.common.HttpType;
|
import com.dispose.common.HttpType;
|
||||||
import com.dispose.common.IpAddrType;
|
import com.dispose.common.IpAddrType;
|
||||||
import com.dispose.common.PrivacyHelper;
|
import com.dispose.common.PrivacyHelper;
|
||||||
import com.dispose.pojo.dto.protocol.base.BaseListResp;
|
|
||||||
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
|
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
|
||||||
import com.dispose.pojo.dto.protocol.base.IdArraysReq;
|
import com.dispose.pojo.dto.protocol.base.IdArraysReq;
|
||||||
import com.dispose.pojo.dto.protocol.base.ProtocolReqDTO;
|
import com.dispose.pojo.dto.protocol.base.ProtocolReqDTO;
|
||||||
|
@ -20,6 +19,7 @@ import com.dispose.pojo.dto.protocol.device.manager.AddDeviceReq;
|
||||||
import com.dispose.pojo.dto.protocol.device.manager.AddDeviceRet;
|
import com.dispose.pojo.dto.protocol.device.manager.AddDeviceRet;
|
||||||
import com.dispose.pojo.dto.protocol.device.manager.AddDeviceRsp;
|
import com.dispose.pojo.dto.protocol.device.manager.AddDeviceRsp;
|
||||||
import com.dispose.pojo.dto.protocol.device.manager.BasePagesGetReq;
|
import com.dispose.pojo.dto.protocol.device.manager.BasePagesGetReq;
|
||||||
|
import com.dispose.pojo.dto.protocol.device.manager.CommDeviceListRsp;
|
||||||
import com.dispose.pojo.dto.protocol.device.manager.DeviceInfoRsp;
|
import com.dispose.pojo.dto.protocol.device.manager.DeviceInfoRsp;
|
||||||
import com.dispose.pojo.dto.protocol.device.manager.GetDeviceDetail;
|
import com.dispose.pojo.dto.protocol.device.manager.GetDeviceDetail;
|
||||||
import com.dispose.pojo.dto.protocol.device.manager.GetDeviceRsp;
|
import com.dispose.pojo.dto.protocol.device.manager.GetDeviceRsp;
|
||||||
|
@ -129,7 +129,7 @@ public class DisposeDeviceManagerController {
|
||||||
@PutMapping("/device")
|
@PutMapping("/device")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ApiOperation("添加处置能力节点")
|
@ApiOperation("添加处置能力节点")
|
||||||
public ProtocolRespDTO<? extends AddDeviceRsp> addDisposeDevice(
|
public ProtocolRespDTO<AddDeviceRsp> addDisposeDevice(
|
||||||
@Validated(ValidGroups.AddDeviceValid.class)
|
@Validated(ValidGroups.AddDeviceValid.class)
|
||||||
@RequestBody ProtocolReqDTO<AddDeviceReq> mr) {
|
@RequestBody ProtocolReqDTO<AddDeviceReq> mr) {
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ public class DisposeDeviceManagerController {
|
||||||
@DeleteMapping("/device")
|
@DeleteMapping("/device")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ApiOperation("删除处置能力节点")
|
@ApiOperation("删除处置能力节点")
|
||||||
public ProtocolRespDTO<BaseListResp<DeviceInfoRsp>> removeDisposeDevice(
|
public ProtocolRespDTO<CommDeviceListRsp> removeDisposeDevice(
|
||||||
@Validated(ValidGroups.ExplicitIdArrayValid.class)
|
@Validated(ValidGroups.ExplicitIdArrayValid.class)
|
||||||
@RequestBody ProtocolReqDTO<IdArraysReq> mr) {
|
@RequestBody ProtocolReqDTO<IdArraysReq> mr) {
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ public class DisposeDeviceManagerController {
|
||||||
List<MulReturnType<ErrorCode, DisposeDevice>> ret =
|
List<MulReturnType<ErrorCode, DisposeDevice>> ret =
|
||||||
disposeDeviceManagerService.removeDisposeDevice(idList);
|
disposeDeviceManagerService.removeDisposeDevice(idList);
|
||||||
|
|
||||||
BaseListResp<DeviceInfoRsp> rspInfo = new BaseListResp<>();
|
CommDeviceListRsp rspInfo = new CommDeviceListRsp();
|
||||||
rspInfo.setItems(new ArrayList<>());
|
rspInfo.setItems(new ArrayList<>());
|
||||||
|
|
||||||
ret.forEach(v -> {
|
ret.forEach(v -> {
|
||||||
|
@ -194,7 +194,7 @@ public class DisposeDeviceManagerController {
|
||||||
DisposeDevice dev = v.getSecondParam();
|
DisposeDevice dev = v.getSecondParam();
|
||||||
|
|
||||||
rsp.setId(String.valueOf(dev.getId()));
|
rsp.setId(String.valueOf(dev.getId()));
|
||||||
rsp.setDevStatus(dev.getStatus());
|
rsp.setDevStatus(dev.getStatus().getValue());
|
||||||
rsp.setStatus(v.getFirstParam().getCode());
|
rsp.setStatus(v.getFirstParam().getCode());
|
||||||
rsp.setMessage(new String[]{v.getFirstParam().getMsg()});
|
rsp.setMessage(new String[]{v.getFirstParam().getMsg()});
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ public class DisposeDeviceManagerController {
|
||||||
@PostMapping("/upgrade")
|
@PostMapping("/upgrade")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ApiOperation("更新处置能力节点")
|
@ApiOperation("更新处置能力节点")
|
||||||
public ProtocolRespDTO<BaseListResp<DeviceInfoRsp>> upgradeDisposeDevice(
|
public ProtocolRespDTO<CommDeviceListRsp> upgradeDisposeDevice(
|
||||||
@Validated(ValidGroups.UpgradeDeviceValid.class)
|
@Validated(ValidGroups.UpgradeDeviceValid.class)
|
||||||
@RequestBody ProtocolReqDTO<AddDeviceReq> mr) {
|
@RequestBody ProtocolReqDTO<AddDeviceReq> mr) {
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ public class DisposeDeviceManagerController {
|
||||||
// 更新设备信息
|
// 更新设备信息
|
||||||
List<MulReturnType<ErrorCode, DisposeDevice>> ret = disposeDeviceManagerService.upgradeDisposeDevice(devs);
|
List<MulReturnType<ErrorCode, DisposeDevice>> ret = disposeDeviceManagerService.upgradeDisposeDevice(devs);
|
||||||
|
|
||||||
BaseListResp<DeviceInfoRsp> rspInfo = new BaseListResp<>();
|
CommDeviceListRsp rspInfo = new CommDeviceListRsp();
|
||||||
rspInfo.setItems(new ArrayList<>());
|
rspInfo.setItems(new ArrayList<>());
|
||||||
|
|
||||||
ret.forEach(v -> {
|
ret.forEach(v -> {
|
||||||
|
@ -232,7 +232,7 @@ public class DisposeDeviceManagerController {
|
||||||
|
|
||||||
disposeDeviceManagerService.getAllDisposeDevice().parallelStream()
|
disposeDeviceManagerService.getAllDisposeDevice().parallelStream()
|
||||||
.filter(k -> k.getId().equals(dev.getId()))
|
.filter(k -> k.getId().equals(dev.getId()))
|
||||||
.findAny().ifPresent(device -> rsp.setDevStatus(device.getStatus()));
|
.findAny().ifPresent(device -> rsp.setDevStatus(device.getStatus().getValue()));
|
||||||
|
|
||||||
rsp.setId(String.valueOf(dev.getId()));
|
rsp.setId(String.valueOf(dev.getId()));
|
||||||
rsp.setStatus(v.getFirstParam().getCode());
|
rsp.setStatus(v.getFirstParam().getCode());
|
||||||
|
|
|
@ -7,7 +7,6 @@ import com.dispose.common.DisposeConfigValue;
|
||||||
import com.dispose.common.ErrorCode;
|
import com.dispose.common.ErrorCode;
|
||||||
import com.dispose.common.Helper;
|
import com.dispose.common.Helper;
|
||||||
import com.dispose.common.NetflowDirection;
|
import com.dispose.common.NetflowDirection;
|
||||||
import com.dispose.pojo.dto.protocol.base.BaseListResp;
|
|
||||||
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
|
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
|
||||||
import com.dispose.pojo.dto.protocol.base.IdArraysReq;
|
import com.dispose.pojo.dto.protocol.base.IdArraysReq;
|
||||||
import com.dispose.pojo.dto.protocol.base.ProtocolReqDTO;
|
import com.dispose.pojo.dto.protocol.base.ProtocolReqDTO;
|
||||||
|
@ -19,6 +18,7 @@ import com.dispose.pojo.dto.protocol.task.GetTaskRsp;
|
||||||
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
|
import com.dispose.pojo.dto.protocol.task.TaskStartMulRsp;
|
||||||
import com.dispose.pojo.dto.protocol.task.TaskStartReq;
|
import com.dispose.pojo.dto.protocol.task.TaskStartReq;
|
||||||
import com.dispose.pojo.dto.protocol.task.TaskStartRsp;
|
import com.dispose.pojo.dto.protocol.task.TaskStartRsp;
|
||||||
|
import com.dispose.pojo.dto.protocol.task.TaskStopItem;
|
||||||
import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
|
import com.dispose.pojo.dto.protocol.task.TaskStopRsp;
|
||||||
import com.dispose.pojo.entity.DeviceTask;
|
import com.dispose.pojo.entity.DeviceTask;
|
||||||
import com.dispose.pojo.entity.DisposeTask;
|
import com.dispose.pojo.entity.DisposeTask;
|
||||||
|
@ -210,11 +210,11 @@ public class DisposeTaskController {
|
||||||
@PostMapping("/stop")
|
@PostMapping("/stop")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ApiOperation("停止处置任务")
|
@ApiOperation("停止处置任务")
|
||||||
public ProtocolRespDTO<?> stopTask(@Validated(ValidGroups.TaskStopReqValid.class)
|
public ProtocolRespDTO<TaskStopRsp> stopTask(@Validated(ValidGroups.TaskStopReqValid.class)
|
||||||
@RequestBody ProtocolReqDTO<IdArraysReq> mr) {
|
@RequestBody ProtocolReqDTO<IdArraysReq> mr) {
|
||||||
|
|
||||||
// 记录多个任务停止信息
|
// 记录多个任务停止信息
|
||||||
BaseListResp<TaskStopRsp> rspList = new BaseListResp<>();
|
TaskStopRsp rspList = new TaskStopRsp();
|
||||||
|
|
||||||
rspList.setItems(new ArrayList<>());
|
rspList.setItems(new ArrayList<>());
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ public class DisposeTaskController {
|
||||||
// 停止处置任务
|
// 停止处置任务
|
||||||
MulReturnType<ErrorCode, DisposeTask> ret = disposeTaskService.stopTask(Long.parseLong(tId));
|
MulReturnType<ErrorCode, DisposeTask> ret = disposeTaskService.stopTask(Long.parseLong(tId));
|
||||||
|
|
||||||
TaskStopRsp rspInfo = TaskStopRsp.builder().build();
|
TaskStopItem rspInfo = TaskStopItem.builder().build();
|
||||||
|
|
||||||
// 停止成功
|
// 停止成功
|
||||||
if (ret.getFirstParam() == ErrorCode.ERR_OK) {
|
if (ret.getFirstParam() == ErrorCode.ERR_OK) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.dispose.pojo.dto.protocol.base;
|
package com.dispose.pojo.dto.protocol.device.manager;
|
||||||
|
|
||||||
|
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -11,9 +12,8 @@ import lombok.NoArgsConstructor;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type Base list resp.
|
* The type Del device rsp.
|
||||||
*
|
*
|
||||||
* @param <T> the type parameter
|
|
||||||
* @author <huangxin@cmhi.chinamoblie.com>
|
* @author <huangxin@cmhi.chinamoblie.com>
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ -23,9 +23,9 @@ import java.util.List;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@JsonPropertyOrder({"items", "status", "message"})
|
@JsonPropertyOrder({"items", "status", "message"})
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class BaseListResp<T> extends BaseRespStatus {
|
public class CommDeviceListRsp extends BaseRespStatus {
|
||||||
/**
|
/**
|
||||||
* The Items.
|
* The Items.
|
||||||
*/
|
*/
|
||||||
private List<T> items;
|
private List<DeviceInfoRsp> items;
|
||||||
}
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package com.dispose.pojo.dto.protocol.device.manager;
|
package com.dispose.pojo.dto.protocol.device.manager;
|
||||||
|
|
||||||
import com.dispose.common.ObjectStatus;
|
|
||||||
import com.dispose.pojo.dto.protocol.base.BaseIdResp;
|
import com.dispose.pojo.dto.protocol.base.BaseIdResp;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
@ -26,5 +25,5 @@ public class DeviceInfoRsp extends BaseIdResp {
|
||||||
/**
|
/**
|
||||||
* The Dev status.
|
* The Dev status.
|
||||||
*/
|
*/
|
||||||
private ObjectStatus devStatus;
|
private Integer devStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.dispose.pojo.dto.protocol.task;
|
||||||
|
|
||||||
|
import com.dispose.pojo.dto.protocol.base.BaseIdResp;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type Task stop item.
|
||||||
|
*
|
||||||
|
* @author <huangxin@cmhi.chinamoblie.com>
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@JsonPropertyOrder({"taskId", "disposeDevice", "type", "disposeIp", "leftTime", "status", "message"})
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
public class TaskStopItem extends BaseIdResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Dispose device.
|
||||||
|
*/
|
||||||
|
private String[] disposeDevice;
|
||||||
|
/**
|
||||||
|
* The Type.
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
/**
|
||||||
|
* The Dispose ip.
|
||||||
|
*/
|
||||||
|
private String disposeIp;
|
||||||
|
/**
|
||||||
|
* The Left time.
|
||||||
|
*/
|
||||||
|
private String leftTime;
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
package com.dispose.pojo.dto.protocol.task;
|
package com.dispose.pojo.dto.protocol.task;
|
||||||
|
|
||||||
import com.dispose.pojo.dto.protocol.base.BaseIdResp;
|
import com.dispose.pojo.dto.protocol.base.BaseRespStatus;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -9,8 +8,10 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type Task stop resp.
|
* The type Task stop rsp.
|
||||||
*
|
*
|
||||||
* @author <huangxin@cmhi.chinamoblie.com>
|
* @author <huangxin@cmhi.chinamoblie.com>
|
||||||
*/
|
*/
|
||||||
|
@ -19,24 +20,10 @@ import lombok.NoArgsConstructor;
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@JsonPropertyOrder({"taskId", "disposeDevice", "type", "disposeIp", "leftTime", "status", "message"})
|
@JsonPropertyOrder({"items", "status", "message"})
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
public class TaskStopRsp extends BaseRespStatus {
|
||||||
public class TaskStopRsp extends BaseIdResp {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Dispose device.
|
* The Items.
|
||||||
*/
|
*/
|
||||||
private String[] disposeDevice;
|
private List<TaskStopItem> items;
|
||||||
/**
|
|
||||||
* The Type.
|
|
||||||
*/
|
|
||||||
private Integer type;
|
|
||||||
/**
|
|
||||||
* The Dispose ip.
|
|
||||||
*/
|
|
||||||
private String disposeIp;
|
|
||||||
/**
|
|
||||||
* The Left time.
|
|
||||||
*/
|
|
||||||
private String leftTime;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue