- PortalProperty 기반 노출 여부 제어 로직 추가 - JSP 뷰모델에 apiSpecV1Enabled 속성 연동
This commit is contained in:
@@ -1608,8 +1608,10 @@
|
||||
<button type="button" class="cssbtn" id="btn_json_export" level="R" status="DETAIL,NEW"><i class="material-icons">download</i> <%=localeMessage.getString("button.exportJson")%></button></button>
|
||||
<button type="button" class="cssbtn" id="btn_delete" level="W" status="DETAIL"><i class="material-icons">delete</i> <%= localeMessage.getString("button.delete") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_modify" level="R" status="DETAIL,NEW"><i class="material-icons">save</i> <%= localeMessage.getString("button.modify") %></button>
|
||||
<!-- v1: 기존 API 스펙 (모달) — 기능 비교용 복원 -->
|
||||
<button type="button" class="cssbtn" id="btn_api_spec" level="R" status="DETAIL"><i class="material-icons">description</i> API 스펙(삭제예정)</button>
|
||||
<%-- v1: 기존 API 스펙 (모달). PTL_PROPERTY(Portal / djb.apispec.v1.enabled) 로 노출 제어. --%>
|
||||
<c:if test="${apiSpecV1Enabled}">
|
||||
<button type="button" class="cssbtn" id="btn_api_spec" level="R" status="DETAIL"><i class="material-icons">description</i> API 스펙</button>
|
||||
</c:if>
|
||||
<!-- v2: 신규 OpenAPI Spec (새 탭) -->
|
||||
<button type="button" class="cssbtn" id="btn_openapi_spec" level="R" status="DETAIL"><i class="material-icons">api</i> OpenAPI Spec</button>
|
||||
<button type="button" class="cssbtn" id="btn_previous" level="R" status="DETAIL,NEW"><i class="material-icons">arrow_back</i> <%= localeMessage.getString("button.previous") %></button>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.eactive.eai.rms.onl.transaction.apim;
|
||||
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommonCommand;
|
||||
import com.eactive.eai.rms.common.base.OnlBaseAnnotationController;
|
||||
@@ -24,6 +25,7 @@ import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -41,13 +43,19 @@ public class ApiInterfaceController extends OnlBaseAnnotationController {
|
||||
|
||||
public static final Log logger = LogFactory.getLog(ApiInterfaceController.class);
|
||||
|
||||
// v1 "API 스펙"(모달) 버튼 노출 여부. PTL_PROPERTY 그룹 'Portal'. 미설정 시 true(현행 노출 유지)로 생성.
|
||||
private static final String API_SPEC_V1_ENABLED_KEY = "djb.apispec.v1.enabled";
|
||||
|
||||
private final ApiInterfaceService service;
|
||||
private final ClientEntityService clientEntityService;
|
||||
private final PortalPropertyService portalPropertyService;
|
||||
|
||||
@Autowired
|
||||
public ApiInterfaceController(ApiInterfaceService service, ClientEntityService clientEntityService) {
|
||||
public ApiInterfaceController(ApiInterfaceService service, ClientEntityService clientEntityService,
|
||||
PortalPropertyService portalPropertyService) {
|
||||
this.service = service;
|
||||
this.clientEntityService = clientEntityService;
|
||||
this.portalPropertyService = portalPropertyService;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/transaction/apim/apiInterfaceMan.view")
|
||||
@@ -55,10 +63,25 @@ public class ApiInterfaceController extends OnlBaseAnnotationController {
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/transaction/apim/apiInterfaceMan.view", params = "cmd=DETAIL")
|
||||
public String viewDetail() {
|
||||
public String viewDetail(Model model) {
|
||||
model.addAttribute("apiSpecV1Enabled", resolveApiSpecV1Enabled());
|
||||
return "/onl/transaction/apim/apiInterfaceManDetail";
|
||||
}
|
||||
|
||||
/** v1 API 스펙 버튼 노출 여부 조회(레거시 Y/N 값도 허용). 미설정/파싱불가 시 true. */
|
||||
private boolean resolveApiSpecV1Enabled() {
|
||||
String v = portalPropertyService.getOrCreateProperty("Portal", API_SPEC_V1_ENABLED_KEY, "true",
|
||||
"API 인터페이스 상세의 v1 'API 스펙'(모달) 버튼 노출 여부(true/false)");
|
||||
if (v == null) {
|
||||
return true;
|
||||
}
|
||||
String s = v.trim();
|
||||
if (s.equalsIgnoreCase("false") || s.equalsIgnoreCase("N")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@PostMapping(value= "/onl/transaction/apim/apiInterfaceMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<ApiInterfaceUI>> selectList(EAIMessageUISearch eaiMessageUISearch,
|
||||
@RequestParam(value = "sortName", required = false, defaultValue = "lastModifiedDate") String sortname,
|
||||
|
||||
Reference in New Issue
Block a user