Files
eapim-online/src/main/java/com/eactive/eai/manage/inflow/InflowGroupBucketController.java
T
yunjy-hp 74aeddf838 feat: 유량제어 그룹 버킷 분리 및 현황 화면 개선
- CustomGroupBucket 클래스 신규 생성: 초당/추가 임계치를 별도 LocalBucket으로 분리하여 개별 토큰 조회 가능
  - InflowControlManager 수정: groupBucketList 타입을 CustomGroupBucket으로 변경, makeGroupBucket() 메서드 추가
  - InflowGroupBucketService 단순화: 복잡한 리플렉션 로직 제거, CustomGroupBucket 직접 메서드 사용
  - 현황 탭에 전체 인스턴스 합산 요약 추가 (활성 인스턴스 수, 초당/추가 임계치 합산)
  - 추가 임계치 시간단위에서 '초(SEC)' 옵션 제거
  - 저장 완료 후 리스트 화면 이동 제거
2025-12-11 11:03:59 +09:00

57 lines
1.9 KiB
Java

package com.eactive.eai.manage.inflow;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/manage/inflow/group")
public class InflowGroupBucketController {
@Autowired
private InflowGroupBucketService bucketService;
/**
* 특정 그룹의 버킷 상태 조회
* GET /manage/inflow/group/{groupId}/bucket-status
*/
@GetMapping("/{groupId}/bucket-status")
public ResponseEntity<?> getGroupBucketStatus(@PathVariable String groupId) {
GroupBucketStatusDTO status = bucketService.getGroupBucketStatus(groupId);
if (status == null) {
Map<String, Object> error = new HashMap<>();
error.put("success", false);
error.put("message", "그룹을 찾을 수 없습니다: " + groupId);
return ResponseEntity.ok(error);
}
Map<String, Object> result = new HashMap<>();
result.put("success", true);
result.put("data", status);
return ResponseEntity.ok(result);
}
/**
* 모든 그룹의 버킷 상태 조회
* GET /manage/inflow/group/bucket-status
*/
@GetMapping("/bucket-status")
public ResponseEntity<?> getAllGroupBucketStatus() {
List<GroupBucketStatusDTO> statusList = bucketService.getAllGroupBucketStatus();
Map<String, Object> result = new HashMap<>();
result.put("success", true);
result.put("data", statusList);
result.put("count", statusList.size());
return ResponseEntity.ok(result);
}
}