chore: acquire-core migration monorepo (legacy C + Spring Boot target skeleton)
Some checks failed
ci / build (push) Failing after 2s
Some checks failed
ci / build (push) Failing after 2s
TxCore/ECPG legacy 매입·정산 C 슬라이스(빌드검증) + Spring Boot 멀티모듈 골격(mvn test green) + MIGRATION.md 전환룰 + CI(boot 빌드).
This commit is contained in:
commit
ff0b0b60a2
31 changed files with 2208 additions and 0 deletions
40
boot/common-framework/pom.xml
Normal file
40
boot/common-framework/pom.xml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.klaro.acquirecore</groupId>
|
||||
<artifactId>acquire-core-boot</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>common-framework</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>common-framework</name>
|
||||
<description>TxCore 의 Spring 대체 공통 프레임워크 스타터 (라이브러리 jar)</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 라이브러리이므로 web/실행 스타터 없이 코어 스타터만 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 라이브러리 모듈은 실행 가능 jar 재패키징을 하지 않는다 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.klaro.acquirecore.framework;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 레거시 {@code msg_layout.h} 고정길이 전문(電文) 코덱의 Spring 빈 자리표시자.
|
||||
*
|
||||
* <p>실 전환에서는 고정길이(positional) 바이트 레이아웃 ↔ DTO 바인딩을 담당한다
|
||||
* (BeanIO 또는 커스텀 코덱). 지금은 스켈레톤이 빈으로 뜨는지만 증명한다.
|
||||
*/
|
||||
@Component
|
||||
public class MessageCodec {
|
||||
|
||||
/** 고정길이 필드를 우측을 공백으로 채워 정규화한다 (자리표시자 구현). */
|
||||
public String padRight(String value, int width) {
|
||||
if (value == null) {
|
||||
value = "";
|
||||
}
|
||||
if (value.length() >= width) {
|
||||
return value.substring(0, width);
|
||||
}
|
||||
return String.format("%-" + width + "s", value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.klaro.acquirecore.framework;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 레거시 TxCore {@code TXBUF} (고정 슬롯 키/값 버퍼) 의 Spring 대체 자리표시자.
|
||||
*
|
||||
* <p>실 전환에서는 요청/응답 DTO(record) 가 정형 필드를 담고, 이 컨텍스트는
|
||||
* 서비스 체인({@code tx_call}) 간 전달되는 느슨한 키/값 상태만 보관한다.
|
||||
*/
|
||||
public final class TxContext {
|
||||
|
||||
private final Map<String, Object> slots = new HashMap<>();
|
||||
|
||||
/** TXBUF 필드 설정 (레거시 {@code Fchg} 상당). */
|
||||
public TxContext put(String key, Object value) {
|
||||
slots.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** TXBUF 필드 조회 (레거시 {@code Fget} 상당). */
|
||||
public Object get(String key) {
|
||||
return slots.get(key);
|
||||
}
|
||||
|
||||
/** 적재된 슬롯 개수. */
|
||||
public int size() {
|
||||
return slots.size();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* TxCore 공통 프레임워크의 Spring 대체 계층.
|
||||
*
|
||||
* <p>레거시 {@code framework/txcore/} (in-process 서비스 디스패처 + 고정 슬롯 TXBUF +
|
||||
* XA 스텁) 를 Spring 관용구로 이식한 자리표시자 스타터다. 실제 전환 시 서비스
|
||||
* 레지스트리는 {@code ApplicationContext} 빈 조회로, {@code tx_call} 은 내부
|
||||
* 빈 호출/Feign 으로, {@code tx_begin/commit} 은 {@code @Transactional} 로 대체된다.
|
||||
*
|
||||
* @see com.klaro.acquirecore.framework.TxContext
|
||||
* @see com.klaro.acquirecore.framework.MessageCodec
|
||||
*/
|
||||
package com.klaro.acquirecore.framework;
|
||||
47
boot/modules/acquiring/pom.xml
Normal file
47
boot/modules/acquiring/pom.xml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.klaro.acquirecore</groupId>
|
||||
<artifactId>acquire-core-boot</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>acquiring</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>acquiring</name>
|
||||
<description>매입(acquiring) 업무 모듈 — common-framework 에 의존하는 Spring Boot 앱</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 2단계 의존: 공통 프레임워크가 먼저 배치되어야 한다 -->
|
||||
<dependency>
|
||||
<groupId>com.klaro.acquirecore</groupId>
|
||||
<artifactId>common-framework</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.klaro.acquirecore.acquiring;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 매입(acquiring) 업무 모듈 부트스트랩.
|
||||
*
|
||||
* <p>레거시 {@code app/online/server_main.c} (tpsvrinit 서비스 등록) 의 Spring 대체.
|
||||
* common-framework(TxCore 대체) 패키지를 컴포넌트 스캔에 포함해 {@code MessageCodec}
|
||||
* 등 프레임워크 빈을 함께 올린다.
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = {
|
||||
"com.klaro.acquirecore.acquiring",
|
||||
"com.klaro.acquirecore.framework"
|
||||
})
|
||||
public class AcquiringApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AcquiringApplication.class, args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
spring:
|
||||
application:
|
||||
name: acquiring
|
||||
# 스켈레톤 단계에서는 데이터소스를 배선하지 않는다(스모크 테스트가 Postgres 불필요).
|
||||
# 매입 DBIO(purchase_dbio.pgc → MyBatis/Spring Data) 이식 시 datasource 를 추가한다.
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.klaro.acquirecore: INFO
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.klaro.acquirecore.acquiring;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* 스켈레톤 스모크 테스트.
|
||||
*
|
||||
* <p>DB/컨텍스트 없이 순수 JUnit 으로 빌드 파이프라인(컴파일 + `mvn test`)이
|
||||
* 초록인지만 증명한다. common-framework 이식이 진행되면 실제 유스케이스
|
||||
* 테스트로 대체된다.
|
||||
*/
|
||||
class SmokeTest {
|
||||
|
||||
@Test
|
||||
void skeletonBuilds() {
|
||||
assertTrue(true, "Spring Boot 매입 모듈 스켈레톤이 빌드된다");
|
||||
}
|
||||
}
|
||||
43
boot/pom.xml
Normal file
43
boot/pom.xml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.3.5</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<groupId>com.klaro.acquirecore</groupId>
|
||||
<artifactId>acquire-core-boot</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>acquire-core-boot</name>
|
||||
<description>Spring Boot 전환 타겟: TxCore 공통 프레임워크 + 매입 업무 모듈</description>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>common-framework</module>
|
||||
<module>modules/acquiring</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- 내부 모듈: common-framework 를 업무 모듈이 참조 -->
|
||||
<dependency>
|
||||
<groupId>com.klaro.acquirecore</groupId>
|
||||
<artifactId>common-framework</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
Reference in a new issue