- JSP: OpenAPI Spec 버튼 상태 표시 및 설명 레이어 추가
- Controller: OpenAPI Spec 상태 조회 API(specStatus) 구현 - Service: API 그룹명 기본값 적용 메서드 추가 및 그룹 설명 UI 구성
This commit is contained in:
@@ -10,6 +10,7 @@ import com.eactive.eai.rms.onl.apim.apigroup.mapping.ApiGroupUIMapper;
|
||||
import com.eactive.eai.rms.onl.apim.apigroup.ui.ApiGroupUI;
|
||||
import com.eactive.eai.rms.onl.apim.apigroup.ui.ApiGroupUISearch;
|
||||
import com.eactive.eai.transformer.util.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -75,6 +76,7 @@ public class ApiGroupManService extends OnlBaseService {
|
||||
}
|
||||
|
||||
public void insert(ApiGroupUI apiGroupUI) {
|
||||
applyContentSubjectDefault(apiGroupUI);
|
||||
ApiGroup apiGroup = apiGroupUIMapper.toEntity(apiGroupUI);
|
||||
for (ApiGroupApi apiGroupApi : apiGroup.getApiGroupApiList()){
|
||||
apiGroupApi.setApiGroup(apiGroup);
|
||||
@@ -86,11 +88,19 @@ public class ApiGroupManService extends OnlBaseService {
|
||||
}
|
||||
|
||||
public void update(ApiGroupUI apiGroupUI) {
|
||||
applyContentSubjectDefault(apiGroupUI);
|
||||
ApiGroup apiGroup = apiGroupService.getById(apiGroupUI.getId());
|
||||
apiGroupUIMapper.updateToEntity(apiGroupUI, apiGroup);
|
||||
apiGroupService.save(apiGroup);
|
||||
}
|
||||
|
||||
// 메인 그룹명(contentSubject) 미입력 시 API 그룹 명(groupName)으로 대체
|
||||
private void applyContentSubjectDefault(ApiGroupUI apiGroupUI) {
|
||||
if (StringUtils.isBlank(apiGroupUI.getContentSubject())) {
|
||||
apiGroupUI.setContentSubject(apiGroupUI.getGroupName());
|
||||
}
|
||||
}
|
||||
|
||||
public void delete(ApiGroupUI apiGroupUI) {
|
||||
ApiGroup apiGroup = apiGroupService.getById(apiGroupUI.getId());
|
||||
apiGroupService.delete(apiGroup);
|
||||
|
||||
@@ -162,6 +162,27 @@ public class DjbApiSpecController extends OnlBaseAnnotationController {
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
// ── 상태조회: apiInterfaceMan 상세의 OpenAPI Spec 버튼 색상용 ──
|
||||
// PTL_API_SPEC_INFO(api_id = eaiSvcName) 존재 여부와 display_yn 만 경량 반환.
|
||||
@PostMapping(value = "/onl/transaction/apim/djbApiSpecMan.json", params = "cmd=SPEC_STATUS")
|
||||
@ResponseBody
|
||||
public ResponseEntity<Map<String, String>> specStatus(String eaiSvcName) {
|
||||
Map<String, String> result = new HashMap<>();
|
||||
boolean exists = false;
|
||||
String displayYn = "N";
|
||||
if (StringUtils.isNotBlank(eaiSvcName)) {
|
||||
// selectDetail 은 미존재 시에도 빈 ApiSpecInfoUI(apiId=null)를 반환하므로 apiId 로 존재 판정.
|
||||
ApiSpecInfoUI saved = apiSpecManService.selectDetail(eaiSvcName);
|
||||
if (saved != null && StringUtils.isNotBlank(saved.getApiId())) {
|
||||
exists = true;
|
||||
displayYn = StringUtils.defaultIfBlank(saved.getDisplayYn(), "N");
|
||||
}
|
||||
}
|
||||
result.put("exists", String.valueOf(exists));
|
||||
result.put("displayYn", displayYn);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
// ── 저장: 마법사 폼 → ApiSpecInfoUI → apiSpecManService.save (기존 재사용) ──
|
||||
@PostMapping(value = "/onl/transaction/apim/djbApiSpecMan.json", params = "cmd=SAVE")
|
||||
@ResponseBody
|
||||
|
||||
Reference in New Issue
Block a user