12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- package com.its.op.controller;
- import com.its.op.dto.ThreadMonitoringDto;
- import com.its.op.dto.WebsocketMonitoringDto;
- import com.its.op.service.ResourceMonitoringService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import lombok.RequiredArgsConstructor;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.http.MediaType;
- import org.springframework.http.ResponseEntity;
- import org.springframework.validation.annotation.Validated;
- import org.springframework.web.bind.annotation.*;
- import java.util.List;
- @Slf4j
- @RequiredArgsConstructor
- @Validated
- @RestController
- @RequestMapping("/api/resource")
- @Api(tags = "00.공통-99.리소스 모니터링")
- public class ResourceMonitoringController {
- private final ResourceMonitoringService resourceMonitoringService;
- @ApiOperation(value = "스레드 리소스 현재값 저장", response = ThreadMonitoringDto.class, responseContainer = "ArrayList")
- @PutMapping(path="/threads/save/{tag}", produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<List<ThreadMonitoringDto>> threadMonitoringSave(@PathVariable final String tag) {
- List<ThreadMonitoringDto> result = this.resourceMonitoringService.threadMonitoringSave(tag);
- return ResponseEntity.ok(result);
- }
- @ApiOperation(value = "스레드 리소스 삭제", response = ThreadMonitoringDto.class, responseContainer = "ArrayList")
- @DeleteMapping(path="/threads/delete/{tag}", produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<List<ThreadMonitoringDto>> threadMonitoringDelete(@PathVariable final String tag) {
- List<ThreadMonitoringDto> result = this.resourceMonitoringService.threadMonitoringDelete(tag);
- return ResponseEntity.ok(result);
- //return ResponseEntity.ok().build();
- }
- @ApiOperation(value = "스레드 리소스 저장값 조회", response = ThreadMonitoringDto.class, responseContainer = "ArrayList")
- @GetMapping(path="/threads/query/{tag}", produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<List<ThreadMonitoringDto>> threadMonitoringQuery(@PathVariable final String tag) {
- List<ThreadMonitoringDto> result = this.resourceMonitoringService.threadMonitoringQuery(tag);
- return ResponseEntity.ok(result);
- }
- @ApiOperation(value = "스레드 리소스 저장값과 현재값 비교", response = ThreadMonitoringDto.class, responseContainer = "ArrayList")
- @GetMapping(path="/threads/diff/{tag}", produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<List<ThreadMonitoringDto>> threadMonitoringDiff(@PathVariable final String tag) {
- List<ThreadMonitoringDto> result = this.resourceMonitoringService.threadMonitoringDiff(tag);
- return ResponseEntity.ok(result);
- }
- @ApiOperation(value = "스레드 리소스 현재값 조회", response = ThreadMonitoringDto.class, responseContainer = "ArrayList")
- @GetMapping(path="/threads", produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<List<ThreadMonitoringDto>> threadMonitoringCurrent() {
- List<ThreadMonitoringDto> result = this.resourceMonitoringService.threadMonitoringCurrent();
- return ResponseEntity.ok(result);
- }
- @ApiOperation(value = "웹소켓 조회", response = WebsocketMonitoringDto.class, responseContainer = "ArrayList")
- @GetMapping(path="/websocket/list", produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<List<WebsocketMonitoringDto>> getWebsocketList() {
- List<WebsocketMonitoringDto> result = this.resourceMonitoringService.getWebsocketList();
- return ResponseEntity.ok(result);
- }
- @ApiOperation(value = "웹소켓 디버그 조회", response = String.class, responseContainer = "ArrayList")
- @GetMapping(path="/websocket/debug/{flag}", produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> getWebsocketDebug(
- @ApiParam(name = "flag", value = "디버그 설정(0 or 1", example = "0", required = true)
- @PathVariable("flag") String flag
- ) {
- String result = this.resourceMonitoringService.getWebsocketDebug(flag);
- return ResponseEntity.ok(result);
- }
- }
|