1. 修改setDataMap函数为addDataMap以防止swagger将DataMap视为一种属性
2. 当任务未通过审核时,现在会立刻报错而不是返回false
This commit is contained in:
@@ -83,14 +83,13 @@ public class ProtectObjectController implements ProtectObjectControllerApi {
|
||||
|
||||
@Override
|
||||
@GetMapping("/{protectObjectId}/query")
|
||||
public ResponseResult queryProtectObject(@PathVariable Integer protectObjectId) throws IllegalAccessException {
|
||||
public ResponseResult queryProtectObject(@PathVariable Integer protectObjectId) {
|
||||
ProtectObject protectObject = protectObjectService.queryProtectObject(protectObjectId);
|
||||
if (protectObject == null) {
|
||||
return ResponseResult.invalid()
|
||||
.setMessage("无效的防护对象ID,也许该ID指定的防护对象不存在?");
|
||||
}
|
||||
return ResponseResult.ok()
|
||||
.setDataMap(EntityUtils.entityToMap(protectObject));
|
||||
return ResponseResult.ok().setData("protect_object", protectObject);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,7 +123,7 @@ public class ProtectObjectController implements ProtectObjectControllerApi {
|
||||
public ResponseResult changeProtectObjectAuditStatus(@PathVariable Integer protectObjectId,
|
||||
@PathVariable Integer auditStatus) {
|
||||
return ResponseResult.ok()
|
||||
.setDataMap(protectObjectService.changeProtectObjectAuditStatus(protectObjectId, auditStatus))
|
||||
.addDataMap(protectObjectService.changeProtectObjectAuditStatus(protectObjectId, auditStatus))
|
||||
.setData("proobj_id", protectObjectId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,7 @@ public class TemplateController implements TemplateControllerApi {
|
||||
return ResponseResult.invalid()
|
||||
.setMessage("无效的策略模板ID,也许该模板不存在?");
|
||||
}
|
||||
return ResponseResult.ok()
|
||||
.setDataMap(EntityUtils.entityToMap(template));
|
||||
return ResponseResult.ok().setData("template", template);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user