임시저장
This commit is contained in:
@@ -0,0 +1,251 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Project Overview
|
||||
|
||||
eLink EMS (eLink Management System) is an enterprise API management platform consisting of three main applications:
|
||||
- **eapim-admin**: Management console for configuration, monitoring, and statistics
|
||||
- **eapim-online**: API gateway for real-time transaction processing
|
||||
- **eapim-portal**: Developer portal for API consumers (Spring Boot-based)
|
||||
|
||||
This directory (`eapim-admin`) contains the management console, built with Spring 5.3 and a hybrid ORM approach (JPA + iBATIS).
|
||||
|
||||
## Build & Development Commands
|
||||
|
||||
### Building the Application
|
||||
|
||||
```bash
|
||||
# Standard WAR build for Tomcat
|
||||
gradle war
|
||||
|
||||
# Build without tests
|
||||
gradle build -x test
|
||||
|
||||
# WebLogic deployment (uses weblogic-web.xml)
|
||||
gradle build -x test -Pprofile=weblogic
|
||||
|
||||
# Clean and rebuild
|
||||
gradle clean build
|
||||
```
|
||||
|
||||
### Running Tests
|
||||
|
||||
```bash
|
||||
# Run all tests
|
||||
gradle test
|
||||
|
||||
# Run specific test class
|
||||
gradle test --tests "com.example.ClassName"
|
||||
```
|
||||
|
||||
### Development Tasks
|
||||
|
||||
```bash
|
||||
# Assemble classes without packaging
|
||||
gradle classes
|
||||
|
||||
# Generate QueryDSL Q-classes and other annotations
|
||||
gradle compileJava
|
||||
|
||||
# View dependency tree
|
||||
gradle dependencies
|
||||
|
||||
# List all available tasks
|
||||
gradle tasks --all
|
||||
```
|
||||
|
||||
## Architecture & Module Dependencies
|
||||
|
||||
### Multi-Module Structure
|
||||
|
||||
eapim-admin references modules from the sibling `eapim-online` directory via settings.gradle:
|
||||
|
||||
```
|
||||
eapim-admin (root project)
|
||||
├── elink-online-core # Core interfaces and domain models
|
||||
├── elink-online-core-jpa # JPA entities and repositories
|
||||
├── elink-online-transformer # Message transformation logic
|
||||
├── elink-online-common # Shared utilities
|
||||
├── elink-online-emsclient # EMS client communication
|
||||
├── elink-portal-common # Portal shared components (JPA entities)
|
||||
└── kjb-safedb # Custom encryption library
|
||||
```
|
||||
|
||||
All module projects are located in `../eapim-online/` and `../` relative to this directory.
|
||||
|
||||
### Hybrid ORM Approach
|
||||
|
||||
This application uses **both JPA and iBATIS**:
|
||||
- **JPA/Hibernate**: Modern data access via `elink-portal-common` (Spring Data repositories)
|
||||
- **iBATIS**: Legacy SQL mapping for existing code (will be migrated over time)
|
||||
|
||||
When working with data access:
|
||||
- New features should use JPA with Spring Data repositories
|
||||
- Legacy iBATIS mappers are in `src/main/resources/sql/` and configured via Spring XML
|
||||
|
||||
### Code Generation
|
||||
|
||||
The build process generates:
|
||||
- **QueryDSL Q-classes**: Type-safe query classes
|
||||
- **Lombok**: Getters/setters/builders via annotation processing
|
||||
- **MapStruct**: Object mappers between DTOs and entities
|
||||
|
||||
#### Dual Q-Class Generation (Gradle + Eclipse)
|
||||
|
||||
This project uses **both Gradle and Eclipse annotation processors**, which means Q-classes are generated in **two locations**:
|
||||
|
||||
1. **`build/generated/java/`** - Generated by Gradle when running `gradle compileJava` or `gradle build`
|
||||
2. **`WebContent/generated/`** - Generated by Eclipse APT when building in Eclipse IDE
|
||||
|
||||
**This is expected behavior and intentional.** Both directories are in `.gitignore` and should NOT be committed.
|
||||
|
||||
#### Working with Generated Code
|
||||
|
||||
- **Gradle builds**: Q-classes in `build/generated/java/` are automatically on the classpath
|
||||
- **Eclipse IDE**: Q-classes in `WebContent/generated/` are automatically on the classpath
|
||||
- **After pulling updates**: Run `gradle compileJava` or refresh Eclipse project to regenerate Q-classes
|
||||
- **IDE errors on Q-classes**: Regenerate by running `gradle clean compileJava` or Eclipse → Project → Clean
|
||||
|
||||
The duplication causes no issues since:
|
||||
- Both tools generate identical Q-classes from the same JPA entities
|
||||
- Both output directories are gitignored
|
||||
- Each tool uses its own generated classes (no classpath conflicts)
|
||||
|
||||
## Local Development Setup
|
||||
|
||||
### Required Environment Variables (Tomcat)
|
||||
|
||||
```
|
||||
-Deai.datasource.type=DEV
|
||||
-Dinst.Name=apimsSvr11
|
||||
-Deai.tableowner=ems
|
||||
-Deai.systemmode=D
|
||||
-Dfile.encoding=utf-8
|
||||
-DLOGBACK_LOG_LEVEL=info
|
||||
```
|
||||
|
||||
### Database Configuration
|
||||
|
||||
The application supports:
|
||||
- **Oracle**: Production database
|
||||
- **PostgreSQL**: Alternative production DB
|
||||
- **H2**: In-memory database for tests
|
||||
|
||||
Database connection is configured via `eai.datasource.type` system property (DEV/STG/PROD).
|
||||
|
||||
### SafeDB Encryption Library
|
||||
|
||||
The `kjb-safedb` module provides three operational modes:
|
||||
- **REAL**: Uses actual SafeDB native library
|
||||
- **FAKE**: Development mode using SHA-256/AES-256 (no SafeDB installation required)
|
||||
- **NONE**: Bypass encryption (for testing only)
|
||||
|
||||
In development, use FAKE mode if SafeDB is not installed locally.
|
||||
|
||||
## Key Features & Functionality
|
||||
|
||||
The admin console manages all aspects of the eLink platform:
|
||||
|
||||
| Feature | Description |
|
||||
|---------|-------------|
|
||||
| User Management | User accounts and authorization |
|
||||
| Transaction Logs | View online/batch/bulk transaction history |
|
||||
| Statistics & Dashboard | Real-time monitoring and metrics |
|
||||
| Interface Management | API interface configuration |
|
||||
| Layout Management | Message layout definitions |
|
||||
| Transformation Rules | Message transformation logic |
|
||||
| Adapter Configuration | Protocol adapters (HTTP, TCP, etc.) |
|
||||
| Routing Rules | Request routing and load balancing |
|
||||
| Batch Processing | Batch interface and adapter management |
|
||||
| Scheduler | Quartz-based job scheduling |
|
||||
|
||||
## Deployment Targets
|
||||
|
||||
The application can be deployed to:
|
||||
- **Tomcat** (default, development)
|
||||
- **WebLogic 14.1.2** (production, requires `-Pprofile=weblogic`)
|
||||
- **JEUS** (supported)
|
||||
- **JBoss/WildFly** (supported with descriptors)
|
||||
|
||||
### WebLogic-Specific Build
|
||||
|
||||
When building for WebLogic, use the `weblogic` profile which replaces `web.xml` with `weblogic-web.xml` to address DefaultServlet issues:
|
||||
|
||||
```bash
|
||||
gradle build -x test -Pprofile=weblogic
|
||||
```
|
||||
|
||||
## Technology Stack
|
||||
|
||||
- **Java 8**: Enforced via Gradle toolchain
|
||||
- **Spring Framework 5.3.27**: Core framework
|
||||
- **Spring Data JPA 2.5.2**: Repository abstraction
|
||||
- **Hibernate 5.4.33**: ORM implementation
|
||||
- **QueryDSL 5.0.0**: Type-safe queries
|
||||
- **iBATIS 2.3.4**: Legacy SQL mapping
|
||||
- **Quartz 2.2.1**: Job scheduling
|
||||
- **Apache POI 3.17**: Excel export functionality
|
||||
- **Jackson 2.13.1**: JSON processing
|
||||
- **Logback 1.2.10**: Logging framework/ㅊ
|
||||
- **AWS SDK 2.20.142**: S3 integration
|
||||
- **Kubernetes Client 18.0.1**: K8s management
|
||||
|
||||
## Project Conventions
|
||||
|
||||
### Package Structure
|
||||
|
||||
```
|
||||
com.eactive.ems/
|
||||
├── controller/ # Spring MVC controllers
|
||||
├── service/ # Business logic
|
||||
├── dao/ # iBATIS DAOs (legacy)
|
||||
├── repository/ # JPA repositories (via elink-portal-common)
|
||||
├── model/ # DTOs and view models
|
||||
└── config/ # Spring configuration classes
|
||||
```
|
||||
|
||||
### Spring Configuration
|
||||
|
||||
The application uses:
|
||||
- **XML-based configuration**: Legacy Spring XML in `WebContent/WEB-INF/`
|
||||
- **Java-based configuration**: Modern `@Configuration` classes
|
||||
- **Component scanning**: Enabled for annotated components
|
||||
|
||||
### Logging
|
||||
|
||||
- Uses **SLF4J** with **Logback** implementation
|
||||
- Log level controlled via `LOGBACK_LOG_LEVEL` system property
|
||||
- All `log4j` dependencies are excluded (configurations in build.gradle)
|
||||
|
||||
## IDE Setup
|
||||
|
||||
### Eclipse
|
||||
|
||||
```bash
|
||||
gradle eclipse
|
||||
```
|
||||
|
||||
This generates:
|
||||
- `.project` and `.classpath` files
|
||||
- Eclipse WTP configuration (context path: `/monitoring`)
|
||||
- UTF-8 encoding settings
|
||||
- Annotation processor configuration for QueryDSL/Lombok
|
||||
|
||||
### IntelliJ IDEA
|
||||
|
||||
```bash
|
||||
gradle idea
|
||||
```
|
||||
|
||||
Alternatively, use "Import Gradle Project" directly in IntelliJ.
|
||||
|
||||
## Testing
|
||||
|
||||
Tests use:
|
||||
- **JUnit 5 (Jupiter)**: Test framework
|
||||
- **Spring Boot Test 2.6.15**: Integration testing utilities
|
||||
- **H2 Database**: In-memory database for tests
|
||||
- **Mockito**: Mocking framework (via Spring Boot Test)
|
||||
|
||||
Test resources are in `src/test/resources` with H2-compatible configurations.
|
||||
@@ -38,6 +38,7 @@ java {
|
||||
|
||||
compileJava {
|
||||
options.encoding = 'UTF-8'
|
||||
options.compilerArgs = ['-parameters']
|
||||
sourceSets.main.java { srcDir generatedJavaDir }
|
||||
options.generatedSourceOutputDirectory = project.file(generatedJavaDir)
|
||||
|
||||
@@ -63,6 +64,7 @@ war {
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = 'UTF-8'
|
||||
options.compilerArgs = ['-parameters']
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ include 'elink-online-transformer'
|
||||
include 'elink-online-common'
|
||||
include 'elink-online-emsclient'
|
||||
include 'elink-portal-common'
|
||||
include 'kjb-safedb'
|
||||
|
||||
project (':elink-online-core-jpa').projectDir = new File(settingsDir, "../eapim-online/elink-online-core-jpa")
|
||||
project (':elink-online-core').projectDir = new File(settingsDir, "../eapim-online/elink-online-core")
|
||||
@@ -13,3 +14,4 @@ project (':elink-online-transformer').projectDir = new File(settingsDir, "../eap
|
||||
project (':elink-online-common').projectDir = new File(settingsDir, "../eapim-online/elink-online-common")
|
||||
project (':elink-online-emsclient').projectDir = new File(settingsDir, "../eapim-online/elink-online-emsclient")
|
||||
project (':elink-portal-common').projectDir = new File(settingsDir, "../elink-portal-common")
|
||||
project (':kjb-safedb').projectDir = new File(settingsDir, "../kjb-safedb")
|
||||
@@ -65,7 +65,6 @@ public class SessionCheckInterceptor extends HandlerInterceptorAdapter {
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
// response.setContentType("application/json;charset=UTF-8");
|
||||
} else {
|
||||
|
||||
//request.getRequestDispatcher("/monitoring/loginForm.do").forward(request, response);
|
||||
//request.getSession().setAttribute("redirectInProgress", true);
|
||||
response.sendRedirect("/monitoring/rms/logout.do");
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.eactive.eai.rms.onl.transaction.apim.mapping.ApiSpecUIMapper;
|
||||
import com.eactive.eai.rms.onl.transaction.apim.ui.ApiInterfaceUI;
|
||||
import com.eactive.eai.rms.onl.transaction.apim.ui.ApiSpecInfoUI;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -142,12 +143,14 @@ public class PortalApprovalManService extends BaseService {
|
||||
AppRequest appRequest = optRequest.get();
|
||||
appApprovalUI.setRequestType(appRequest.getType());
|
||||
|
||||
if (StringUtils.isNotEmpty(appRequest.getApiGroupList())) {
|
||||
String[] apiGroupList = appRequest.getApiGroupList().split(",");
|
||||
for (String apiGroupId : apiGroupList) {
|
||||
apiGroupService.findByIdWithApiList(apiGroupId).ifPresent(apiGroup ->
|
||||
appApprovalUI.getApiServices().add(apiGroupUIMapper.toVo(apiGroup))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> currentGroupNameList = new ArrayList<>();
|
||||
processApiList(appRequest.getApiList(), appApprovalUI.getApis(), currentGroupNameList);
|
||||
|
||||
+2
-1
@@ -7,6 +7,7 @@ import com.eactive.apim.portal.approval.entity.Approval;
|
||||
import com.eactive.apim.portal.approval.service.ApprovalDeployException;
|
||||
import com.eactive.apim.portal.approval.statemachine.listener.ApprovalListener;
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
||||
import com.eactive.apim.portal.template.service.MessageSendService;
|
||||
import com.eactive.eai.agent.command.CommonCommand;
|
||||
@@ -101,7 +102,7 @@ public class PortalAppApprovalListener implements ApprovalListener {
|
||||
recipient.setUserId(appRequest.getApproval().getRequester().getEmailAddr());
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("apiKey", appRequest.getClientName());
|
||||
messageSendService.sendMessage("APP_REGISTER_APPROVED", recipient, params);
|
||||
messageSendService.sendMessage(MessageCode.APP_REGISTER_APPROVED, recipient, params);
|
||||
}
|
||||
|
||||
private void syncTargetServer(AppRequestType action, CredentialUI credentialUI) throws ApprovalDeployException {
|
||||
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
package com.eactive.eai.rms.onl.apim.approval.apprequest;
|
||||
|
||||
import com.eactive.eai.rms.common.base.OnlBaseAnnotationController;
|
||||
import com.eactive.eai.rms.common.vo.GridResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.web.SortDefault;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class PortalAppRequestManController extends OnlBaseAnnotationController {
|
||||
|
||||
private final PortalAppRequestManService portalAppRequestManService;
|
||||
|
||||
@GetMapping(value = "/onl/apim/approval/apprequest/prodAppRequestMan.view")
|
||||
public void view() {
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/apim/approval/apprequest/prodAppRequestMan.view", params = "cmd=DETAIL")
|
||||
public String detailView() {
|
||||
return "/onl/apim/approval/apprequest/prodAppRequestManPopup";
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/approval/apprequest/prodAppRequestMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<AppRequestUI>> selectList(@SortDefault(value = "createdDate", direction = Sort.Direction.DESC) Pageable pageable,
|
||||
AppRequestUISearch appRequestUISearch) {
|
||||
Page<AppRequestUI> page = portalAppRequestManService.selectList(pageable, appRequestUISearch);
|
||||
return ResponseEntity.ok(new GridResponse<>(page));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/approval/apprequest/prodAppRequestMan.json", params = "cmd=DETAIL")
|
||||
public ResponseEntity<AppRequestUI> selectDetail(String id) {
|
||||
AppRequestUI portalApprovalUI = portalAppRequestManService.selectDetail(id);
|
||||
return ResponseEntity.ok(portalApprovalUI);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/approval/apprequest/prodAppRequestMan.json", params = "cmd=UPDATE")
|
||||
public ResponseEntity<AppRequestUI> update(AppRequestUI appRequestUI) {
|
||||
AppRequestUI portalApprovalUI = portalAppRequestManService.update(appRequestUI);
|
||||
return ResponseEntity.ok(portalApprovalUI);
|
||||
}
|
||||
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
package com.eactive.eai.rms.onl.apim.approval.apprequest;
|
||||
|
||||
import com.eactive.apim.portal.apispec.service.ApiSpecInfoService;
|
||||
import com.eactive.apim.portal.apprequest.entity.AppRequest;
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Transactional(transactionManager = "transactionManagerForEMS")
|
||||
@RequiredArgsConstructor
|
||||
public class PortalAppRequestManService extends BaseService {
|
||||
|
||||
private final ApiSpecInfoService apiSpecInfoService;
|
||||
private final PortalAppRequestService portalAppRequestService;
|
||||
private final AppRequestUIMapper appRequestUIMapper;
|
||||
|
||||
public Page<AppRequestUI> selectList(Pageable pageable, AppRequestUISearch appRequestUISearch) {
|
||||
return portalAppRequestService.findAllProd(pageable, appRequestUISearch)
|
||||
.map(appRequest -> appRequestUIMapper.toVo(appRequest));
|
||||
}
|
||||
|
||||
public AppRequestUI selectDetail(String id) {
|
||||
AppRequest appRequest = portalAppRequestService.getById(id);
|
||||
|
||||
return appRequestUIMapper.toVo(appRequest);
|
||||
}
|
||||
|
||||
public AppRequestUI update(AppRequestUI appRequestUI) {
|
||||
AppRequest appRequest = portalAppRequestService.getById(appRequestUI.getId());
|
||||
appRequestUIMapper.updateToEntity(appRequestUI, appRequest);
|
||||
|
||||
appRequest = portalAppRequestService.save(appRequest);
|
||||
return appRequestUIMapper.toVo(appRequest);
|
||||
}
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
package com.eactive.eai.rms.onl.apim.approval.apprequest;
|
||||
|
||||
import com.eactive.apim.portal.apprequest.entity.AppRequest;
|
||||
import com.eactive.apim.portal.apprequest.entity.AppRequestType;
|
||||
import com.eactive.apim.portal.apprequest.entity.QAppRequest;
|
||||
import com.eactive.apim.portal.apprequest.repository.AppRequestRepository;
|
||||
import com.eactive.eai.rms.data.jpa.AbstractEMSDataSerivce;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PortalAppRequestService extends AbstractEMSDataSerivce<AppRequest, String, AppRequestRepository> {
|
||||
|
||||
public Page<AppRequest> findAllProd(Pageable pageable, AppRequestUISearch uiSearch) {
|
||||
QAppRequest qAppRequest = QAppRequest.appRequest;
|
||||
|
||||
BooleanBuilder predicate = new BooleanBuilder();
|
||||
predicate.and(qAppRequest.type.eq(AppRequestType.PROD_NEW));
|
||||
|
||||
return repository.findAll(predicate, pageable);
|
||||
}
|
||||
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package com.eactive.eai.rms.onl.apim.approval.prodclient;
|
||||
|
||||
import com.eactive.apim.portal.app.entity.ProdClient;
|
||||
import com.eactive.eai.data.jpa.BaseRepository;
|
||||
import com.eactive.eai.rms.data.EMSDataSource;
|
||||
|
||||
@EMSDataSource
|
||||
public interface ProdClientEMSRepository extends BaseRepository<ProdClient, String> {
|
||||
|
||||
}
|
||||
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
package com.eactive.eai.rms.onl.apim.approval.prodclient;
|
||||
|
||||
import com.eactive.eai.rms.common.base.OnlBaseAnnotationController;
|
||||
import com.eactive.eai.rms.common.vo.GridResponse;
|
||||
import java.util.Map;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.web.SortDefault;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
public class ProdClientManController extends OnlBaseAnnotationController {
|
||||
|
||||
private final ProdClientManService prodClientManService;
|
||||
|
||||
@GetMapping(value = "/onl/apim/approval/prodclient/clientMan.view")
|
||||
public void view() {
|
||||
}
|
||||
|
||||
@GetMapping(value = "/onl/apim/approval/prodclient/clientMan.view", params = "cmd=DETAIL")
|
||||
public String detailView() {
|
||||
return "/onl/apim/approval/prodclient/clientManDetail";
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/approval/prodclient/clientMan.json", params = "cmd=LIST")
|
||||
public ResponseEntity<GridResponse<ProdClientUI>> selectList(@SortDefault("clientname") Pageable pageable,
|
||||
ProdClientSearch clientSearch) {
|
||||
Page<ProdClientUI> page = prodClientManService.selectList(pageable, clientSearch);
|
||||
return ResponseEntity.ok(new GridResponse<>(page));
|
||||
}
|
||||
|
||||
@PostMapping(value= "/onl/apim/approval/prodclient/clientMan.json",params = "cmd=LIST_DETAIL_COMBO")
|
||||
public ResponseEntity<Map<String, Object>> selectDetailCombo() throws Exception {
|
||||
Map<String, Object> map = prodClientManService.selectDetailCombo();
|
||||
return ResponseEntity.ok(map);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/approval/prodclient/clientMan.json", params = "cmd=DETAIL")
|
||||
public ResponseEntity<ProdClientUI> selectDetail(String clientId) {
|
||||
ProdClientUI clientUI = prodClientManService.selectDetail(clientId);
|
||||
return ResponseEntity.ok(clientUI);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/approval/prodclient/clientMan.json", params = "cmd=INSERT")
|
||||
public ResponseEntity<Void> insert(ProdClientUI clientUI) {
|
||||
prodClientManService.insert(clientUI);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/approval/prodclient/clientMan.json", params = "cmd=UPDATE")
|
||||
public ResponseEntity<Void> update(ProdClientUI clientUI) {
|
||||
prodClientManService.update(clientUI);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/apim/approval/prodclient/clientMan.json", params = "cmd=DELETE")
|
||||
public ResponseEntity<Void> delete(String clientId) {
|
||||
prodClientManService.delete(clientId);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
}
|
||||
-64
@@ -1,64 +0,0 @@
|
||||
package com.eactive.eai.rms.onl.apim.approval.prodclient;
|
||||
|
||||
import com.eactive.apim.portal.app.entity.ProdClient;
|
||||
import com.eactive.apim.portal.portalorg.entity.PortalOrg;
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.data.entity.onl.apim.portalorg.PortalOrgService;
|
||||
import com.eactive.eai.rms.onl.apim.portalorg.PortalOrgUI;
|
||||
import com.eactive.eai.rms.onl.apim.portalorg.PortalOrgUIMapper;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Transactional(transactionManager = "transactionManagerForEMS")
|
||||
@RequiredArgsConstructor
|
||||
public class ProdClientManService extends BaseService {
|
||||
|
||||
private final ProdClientService prodClientService;
|
||||
private final ProdClientUIMapper prodClientUIMapper;
|
||||
private final PortalOrgService portalOrgService;
|
||||
private final PortalOrgUIMapper portalOrgUIMapper;
|
||||
|
||||
public Page<ProdClientUI> selectList(Pageable pageable, ProdClientSearch prodClientSearch) {
|
||||
Page<ProdClient> page = prodClientService.findAll(pageable, prodClientSearch);
|
||||
return page.map(prodClientUIMapper::toVo);
|
||||
}
|
||||
|
||||
public HashMap<String, Object> selectDetailCombo() {
|
||||
List<PortalOrg> portalOrgList = portalOrgService.findByOrgStatusAndApprovalStatus("ACTIVE", "COMPLETED");
|
||||
List<PortalOrgUI> portalOrgUIList = portalOrgList.stream()
|
||||
.map(portalOrgUIMapper::toVo)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("portalOrgList", portalOrgUIList);
|
||||
return map;
|
||||
}
|
||||
|
||||
public ProdClientUI selectDetail(String clientId) {
|
||||
ProdClient prodClient = prodClientService.getById(clientId);
|
||||
return prodClientUIMapper.toVo(prodClient);
|
||||
}
|
||||
|
||||
public void insert(ProdClientUI prodClientUI) {
|
||||
ProdClient prodClient = prodClientUIMapper.toEntity(prodClientUI);
|
||||
prodClient.setAppstatus("1"); // Set default status to normal
|
||||
prodClientService.save(prodClient);
|
||||
}
|
||||
|
||||
public void update(ProdClientUI prodClientUI) {
|
||||
ProdClient prodClient = prodClientService.getById(prodClientUI.getClientid());
|
||||
prodClientUIMapper.updateToEntity(prodClientUI, prodClient);
|
||||
prodClientService.save(prodClient);
|
||||
}
|
||||
|
||||
public void delete(String clientId) {
|
||||
prodClientService.deleteById(clientId);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.eactive.eai.rms.onl.apim.approval.prodclient;
|
||||
|
||||
import com.eactive.apim.portal.app.entity.ProdClient;
|
||||
import com.eactive.apim.portal.app.entity.QProdClient;
|
||||
import com.eactive.eai.data.jpa.AbstractDataService;
|
||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class ProdClientService extends AbstractDataService<ProdClient, String, ProdClientEMSRepository> {
|
||||
|
||||
public Page<ProdClient> findAll(Pageable pageable, ProdClientSearch clientSearch) {
|
||||
QProdClient qClientEntity = QProdClient.prodClient;
|
||||
|
||||
BooleanExpression predicate = qClientEntity.clientname.containsIgnoreCase(clientSearch.getSearchClientName());
|
||||
|
||||
if (StringUtils.isNotBlank(clientSearch.getSearchClientId())) {
|
||||
predicate = predicate.and(qClientEntity.clientid.containsIgnoreCase(clientSearch.getSearchClientId()));
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(clientSearch.getSearchOrgId())) {
|
||||
predicate = predicate.and(qClientEntity.orgid.eq(clientSearch.getSearchOrgId()));
|
||||
}
|
||||
|
||||
return repository.findAll(predicate, pageable);
|
||||
}
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package com.eactive.eai.rms.onl.apim.approval.prodclient;
|
||||
|
||||
import com.eactive.apim.portal.app.entity.ProdClient;
|
||||
import com.eactive.eai.data.mapper.BaseMapperConfig;
|
||||
import com.eactive.eai.data.mapper.GenericMapper;
|
||||
import com.eactive.eai.rms.onl.transaction.apim.mapping.ApiSpecUIMapper;
|
||||
import org.mapstruct.BeanMapping;
|
||||
import org.mapstruct.InheritInverseConfiguration;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.MappingTarget;
|
||||
import org.mapstruct.NullValuePropertyMappingStrategy;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
@Mapper(config = BaseMapperConfig.class, componentModel = "spring", uses = {ApiSpecUIMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public abstract class ProdClientUIMapper implements GenericMapper<ProdClientUI, ProdClient> {
|
||||
|
||||
@InheritInverseConfiguration
|
||||
@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
|
||||
@Mapping(target = "apiList", expression = "java(apiSpecUIMapper.mapList(prodClientUI.getApiList()))")
|
||||
public abstract void updateToEntity(ProdClientUI prodClientUI, @MappingTarget ProdClient prodClient);
|
||||
}
|
||||
+2
-1
@@ -9,6 +9,7 @@ import com.eactive.apim.portal.portalorg.entity.PortalOrgEnums.OrgStatus;
|
||||
import com.eactive.apim.portal.portalproperty.service.PortalPropertyService;
|
||||
import com.eactive.apim.portal.portaluser.entity.PortalUser;
|
||||
import com.eactive.apim.portal.portaluser.entity.PortalUserEnums;
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
||||
import com.eactive.apim.portal.template.service.MessageSendService;
|
||||
import com.eactive.eai.rms.data.entity.onl.apim.portalorg.PortalOrgService;
|
||||
@@ -96,7 +97,7 @@ public class PortalUserApprovalListener implements ApprovalListener {
|
||||
recipient.setPhone(portalUser.getMobileNumber());
|
||||
recipient.setUserId(portalUser.getEmailAddr());
|
||||
Map<String, String> params = new HashMap<>();
|
||||
messageSendService.sendMessage("USER_REGISTER_APPROVED", recipient, params);
|
||||
messageSendService.sendMessage(MessageCode.USER_REGISTRATION_APPROVED, recipient, params);
|
||||
}
|
||||
|
||||
private void syncStaging(PortalOrgUI portalOrgUI) throws ApprovalDeployException {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# HotSwapAgent 설정
|
||||
# Spring 관련
|
||||
Spring.reload=true
|
||||
# Hibernate 관련
|
||||
Hibernate.reload=true
|
||||
# 로그 레벨
|
||||
logLevel=INFO
|
||||
# 자동 Hot Swap 활성화
|
||||
autoHotswap=true
|
||||
Reference in New Issue
Block a user