diff --git a/WebContent/jsp/onl/admin/authserver/scopeManDetail.jsp b/WebContent/jsp/onl/admin/authserver/scopeManDetail.jsp index 1de52b6..8a78458 100644 --- a/WebContent/jsp/onl/admin/authserver/scopeManDetail.jsp +++ b/WebContent/jsp/onl/admin/authserver/scopeManDetail.jsp @@ -18,6 +18,8 @@ @@ -161,7 +320,25 @@ $(document).ready(function() { - + +
+
+
API
+
+ + +
+
+
+
+
+
+
+
diff --git a/WebContent/jsp/onl/apim/apigroup/apiGroupManPopup.jsp b/WebContent/jsp/onl/apim/apigroup/apiGroupManPopup.jsp index 039c019..0654ec0 100644 --- a/WebContent/jsp/onl/apim/apigroup/apiGroupManPopup.jsp +++ b/WebContent/jsp/onl/apim/apigroup/apiGroupManPopup.jsp @@ -27,9 +27,11 @@ for(var i = 0; i < selectedRowIds.length; i++) { var rowData = grid.jqGrid('getRowData', selectedRowIds[i]); selectedData.push({ - bizCode: rowData.eaiBzwkDstcd, + bizCode: rowData.eaiBzwkDstcd, // CLINET apiId: rowData.eaiSvcName, - apiDesc: rowData.eaiSvcDesc + apiDesc: rowData.eaiSvcDesc, // SCOPE-API + APIFULLPATH: rowData.apiFullPath, + BZWKSVCKEYNAME: rowData.bzwksvckeyname }); } @@ -108,6 +110,7 @@ 'API ID', 'API 명', 'API FULL PATH', + '업무서비스명', '요청', '응답', '작성자', @@ -117,12 +120,13 @@ colModel : [ { name : 'eaiBzwkDstcd' , align : 'center' , width:'40', sortable:false}, { name : 'eaiSvcName' , align : 'left' , width:'100'}, { name : 'eaiSvcDesc' , align : 'left' }, - { name : 'apiFullPath' , align : 'left' , width:'180'}, + { name : 'apiFullPath' , align : 'left' , width:'100'}, + { name : 'bzwksvckeyname' , align : 'left' , width:'100', hidden: true}, { name : 'fromAdapter' , align : 'center' , width:'40', formatter:adapterNameShortFormatter }, { name : 'toAdapter' , align : 'center' , width:'40', formatter:adapterNameShortFormatter }, { name : 'author' , align : 'center' , width:'60' }, { name : 'simYn' , align : 'center' , width:'40' }, - { name : 'syncAsyncType' , align : 'center' , width:'40', hidden: true }, + { name : 'syncAsyncType' , align : 'center' , width:'40', hidden: true}, ], jsonReader : { repeatitems : false diff --git a/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/ApiScopeDto.java b/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/ApiScopeDto.java index 2fe0ff2..9916ce4 100644 --- a/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/ApiScopeDto.java +++ b/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/ApiScopeDto.java @@ -9,6 +9,9 @@ import lombok.Data; @AllArgsConstructor public class ApiScopeDto { + @JsonProperty("EAISVCNAME") + private String eaiSvcName; + @JsonProperty("EAISVCDESC") private String eaiSvcDesc; @@ -20,5 +23,8 @@ public class ApiScopeDto { @JsonProperty("SCOPENAME") private String scopeName; + + @JsonProperty("APIFULLPATH") + private String apiFullPath; } diff --git a/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/EAIMessageService.java b/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/EAIMessageService.java index 06298a1..4bf2428 100644 --- a/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/EAIMessageService.java +++ b/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/EAIMessageService.java @@ -59,6 +59,8 @@ public class EAIMessageService extends AbstractDataService result = getJPAQueryFactory() .select(Projections.constructor(ApiScopeDto.class , + qEaiMessageEntity.eaisvcname , qEaiMessageEntity.eaisvcdesc , qScopeEntity.id.scopeid , qScopeEntity.id.bzwksvckeyname , - qScopeInfo.scopeName )) + qScopeInfo.scopeName , + qStandardMessageInfo.apifullpath + ) + ) .from(qEaiMessageEntity) .join(qStandardMessageInfo) .on(qEaiMessageEntity.eaisvcname.eq(qStandardMessageInfo.eaisvcname)) @@ -313,19 +320,20 @@ public class EAIMessageService extends AbstractDataService insertApiScopeList(@RequestParam("apiList") String apiListJson, @RequestParam("scopeId") String scopeId) { + + ObjectMapper mapper = new ObjectMapper(); + List apiScopeList = null; + + try { + apiScopeList = mapper.readValue(apiListJson, new TypeReference>(){}); + + } catch (Exception e) { + throw new BizException("데이터 변환 중 오류가 발생했습니다."); + } + + apiScopeManService.insertApiScopeRelationList(apiScopeList, scopeId); + + return ResponseEntity.ok().build(); + } + + @PostMapping(value = "/onl/admin/authserver/apiScopeMan.json", params = "cmd=DELETE") public ResponseEntity deleteApiScope(ApiScopeUI apiScopeUI) { apiScopeManService.deleteApiScopeRelation(apiScopeUI); diff --git a/src/main/java/com/eactive/eai/rms/onl/manage/authserver/scope/ApiScopeManService.java b/src/main/java/com/eactive/eai/rms/onl/manage/authserver/scope/ApiScopeManService.java index b1caa62..fe68165 100644 --- a/src/main/java/com/eactive/eai/rms/onl/manage/authserver/scope/ApiScopeManService.java +++ b/src/main/java/com/eactive/eai/rms/onl/manage/authserver/scope/ApiScopeManService.java @@ -11,6 +11,8 @@ import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.eactive.eai.agent.authserver.ReloadApiScopeCommand; +import com.eactive.eai.agent.command.CommonCommand; import com.eactive.eai.rms.common.base.OnlBaseService; import com.eactive.eai.rms.common.spring.LocaleMessage; import com.eactive.eai.rms.data.entity.onl.authserver.ScopeEntityService; @@ -56,10 +58,12 @@ public class ApiScopeManService extends OnlBaseService { private ApiScopeUI convertToApiScopeUI(ApiScopeDto dto) { ApiScopeUI apiScopeUI = new ApiScopeUI(); - apiScopeUI.setEaiSvcDesc(dto.getEaiSvcDesc()); + apiScopeUI.setApiDesc(dto.getEaiSvcDesc()); apiScopeUI.setScopeId(dto.getScopeId()); apiScopeUI.setBzwkSvcKeyName(dto.getBzwkSvcKeyName()); apiScopeUI.setScopeName(dto.getScopeName()); + apiScopeUI.setApiFullPath(dto.getApiFullPath()); + apiScopeUI.setApiId(dto.getEaiSvcName()); return apiScopeUI; } @@ -72,6 +76,32 @@ public class ApiScopeManService extends OnlBaseService { scopeEntityService.save(apiScopeUIMapper.toEntity(apiScopeUI)); } + public void insertApiScopeRelationList(List apiScopeList, String scopeId) { + // ScopeId 기준 전체 삭제 후 LIST 기준으로 저장. + if(scopeId == null || scopeId.isEmpty()) { + throw new BizException("ScopeId 가 존재하지 않습니다."); + } + + scopeEntityService.deleteByIdScopeId(scopeId); + + if(apiScopeList == null || apiScopeList.isEmpty()) { + return; + } + + for (ApiScopeUI ui : apiScopeList) { + ui.setScopeId(scopeId); + + scopeEntityService.save(apiScopeUIMapper.toEntity(ui)); + + CommonCommand.builder() + .name(CommonCommand.RELOAD_API_SCOPE_COMMAND) + .args(new String[] {ReloadApiScopeCommand.COMMAND_TYPE_API_SCOPE, + ui.getBzwkSvcKeyName(), ui.getScopeId()}) + .build() + .broadcast(agentUtilService); + } + } + public void deleteApiScopeRelation(ApiScopeUI apiScopeUI) { scopeEntityService.deleteById(apiScopeUIMapper.toId(apiScopeUI)); } diff --git a/src/main/java/com/eactive/eai/rms/onl/manage/authserver/scope/ApiScopeUI.java b/src/main/java/com/eactive/eai/rms/onl/manage/authserver/scope/ApiScopeUI.java index f1407fd..a213032 100644 --- a/src/main/java/com/eactive/eai/rms/onl/manage/authserver/scope/ApiScopeUI.java +++ b/src/main/java/com/eactive/eai/rms/onl/manage/authserver/scope/ApiScopeUI.java @@ -1,10 +1,14 @@ package com.eactive.eai.rms.onl.manage.authserver.scope; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; +import lombok.NoArgsConstructor; @Data +@NoArgsConstructor // jackson 사용을 위해 추가. +@JsonIgnoreProperties(ignoreUnknown = true) public class ApiScopeUI { @JsonProperty("SCOPEID") @@ -16,7 +20,13 @@ public class ApiScopeUI { @JsonProperty("SCOPENAME") private String scopeName; - @JsonProperty("EAISVCDESC") - private String eaiSvcDesc; + @JsonProperty("apiDesc") + private String apiDesc; + + @JsonProperty("APIFULLPATH") + private String apiFullPath; + + @JsonProperty("apiId") + private String apiId; } diff --git a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java index b45bcec..f46f749 100644 --- a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java +++ b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java @@ -139,6 +139,7 @@ public class ApiInterfaceService extends OnlBaseService { EAIMessageEntity eaiMessageEntity = tuple.get(QEAIMessageEntity.eAIMessageEntity); String apiFullPath = tuple.get(QStandardMessageInfo.standardMessageInfo.apifullpath); + String bzwksvckeyname = tuple.get(QStandardMessageInfo.standardMessageInfo.bzwksvckeyname); ApiInterfaceUI apiInterfaceUI; if (eaiMessageEntity.getServiceMessages() != null && eaiMessageEntity.getServiceMessages().size() > 0) { @@ -148,6 +149,7 @@ public class ApiInterfaceService extends OnlBaseService { } apiInterfaceUI.setApiFullPath(apiFullPath); + apiInterfaceUI.setBzwksvckeyname(bzwksvckeyname); return apiInterfaceUI; }); diff --git a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ui/ApiInterfaceUI.java b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ui/ApiInterfaceUI.java index a464377..9f34cc0 100644 --- a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ui/ApiInterfaceUI.java +++ b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ui/ApiInterfaceUI.java @@ -51,6 +51,7 @@ public class ApiInterfaceUI { private List inboundResponseStandardMessageItems ; private String apiFullPath; + private String bzwksvckeyname; //ASYNC-SYNC 용 private String inboundResponseHttpMethod;