|
|
@@ -163,6 +163,12 @@ public class ItMonitorController {
|
|
|
return new Result<>(ResultCode.SUCCESS, itMonitorService.getResourceDetailsByGroupId(id));
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/resource/get-by-rid/{i}")
|
|
|
+ public Result<ItMonitorItMonitorResourceDetailsVo> getItMonitorResourceByResourceId(@PathVariable String i) {
|
|
|
+ Long id = Long.parseLong(i);
|
|
|
+ return new Result<>(ResultCode.SUCCESS, itMonitorService.getResourceDetailsByResourceId(id));
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/resource/add")
|
|
|
public Result<?> addItMonitorResource(@Validated @RequestBody ItMonitorResource itMonitorResource) {
|
|
|
if (!itMonitorService.checkAgentExistByAgentId(itMonitorResource.getAgentId())
|
|
|
@@ -243,6 +249,12 @@ public class ItMonitorController {
|
|
|
return new Result<>(ResultCode.SUCCESS, itMonitorService.getAllItemByGroupId(id));
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/item/get-by-tid/{i}")
|
|
|
+ public Result<List<ItMonitorItem>> getItMonitorItemByTemplateId(@PathVariable String i) {
|
|
|
+ Long id = Long.parseLong(i);
|
|
|
+ return new Result<>(ResultCode.SUCCESS, itMonitorService.getItemByTemplateId(id));
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/item/add") // TODO: check groupId
|
|
|
public Result<?> addItMonitorItem(@Validated @RequestBody ItMonitorItem itMonitorItem) {
|
|
|
if (itMonitorItem.getItemGroupId() == null ||
|