chore: 落地 eip4-platform 多模块骨架基线(PoC→工程化)
从 eip4-poc 迁入双层制模块化单体:保真层 platform-legacy-core (com.dsasp 引擎原样)+ 现代层 platform-metadata/auth/flow-gateway/ converter/ai + platform-app 启动器。ArchUnit 纪律固化(保真层禁依赖现代层)。 此为 C1 对拍工作的编译通过基线。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
39
platform-app/pom.xml
Normal file
39
platform-app/pom.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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.eip4</groupId>
|
||||
<artifactId>eip4-platform</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>platform-app</artifactId>
|
||||
<name>platform-app</name>
|
||||
<description>Spring Boot 启动器,组装全部模块。单客户交付形态四进程之一(eip4-platform.jar)</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency><groupId>com.eip4</groupId><artifactId>platform-legacy-core</artifactId></dependency>
|
||||
<dependency><groupId>com.eip4</groupId><artifactId>platform-metadata</artifactId></dependency>
|
||||
<dependency><groupId>com.eip4</groupId><artifactId>platform-auth</artifactId></dependency>
|
||||
<dependency><groupId>com.eip4</groupId><artifactId>platform-flow-gateway</artifactId></dependency>
|
||||
<dependency><groupId>com.eip4</groupId><artifactId>platform-converter</artifactId></dependency>
|
||||
<dependency><groupId>com.eip4</groupId><artifactId>platform-ai</artifactId></dependency>
|
||||
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>
|
||||
<dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId><scope>runtime</scope></dependency>
|
||||
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency>
|
||||
<!-- 模块边界纪律:ArchUnit 规则跑在能看到全部类的 app 模块测试里 -->
|
||||
<dependency><groupId>com.tngtech.archunit</groupId><artifactId>archunit-junit5</artifactId><scope>test</scope></dependency>
|
||||
<!-- 对拍框架进 app 集成测试 classpath,亦可独立 CLI -->
|
||||
<dependency><groupId>com.eip4</groupId><artifactId>platform-parity</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,17 @@
|
||||
package com.eip4.platform.app;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* EIP3 路线 A' PoC(WS1):POJOCRUDService/POJOService 元数据引擎
|
||||
* 从 OSGi/Spring 3.1/JDK 6 移植到 Spring Boot 3 / JDK 17 的验证工程。
|
||||
* 扫描范围覆盖移植代码包 com.dsasp 与新代码包 com.eip4.platform。
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = {"com.eip4.platform", "com.dsasp"})
|
||||
public class Eip4PlatformApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Eip4PlatformApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.eip4.platform.app.config;
|
||||
|
||||
import org.springframework.beans.factory.SmartInitializingSingleton;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.fasterxml.jackson.datatype.joda.JodaModule;
|
||||
|
||||
import com.dsasp.server.common.log.service.DataOperatorLog;
|
||||
import com.dsasp.server.common.log.service.SystemLogManager;
|
||||
import com.dsasp.server.dataDic.service.POJOCRUDServiceImpl;
|
||||
import com.dsasp.server.dataDic.service.POJOServiceImpl;
|
||||
|
||||
/**
|
||||
* 等价替代原 com.dsasp.server.dataDic/META-INF/spring/service.xml 的
|
||||
* <property> setter 装配:systemLogManager / dataOperatorLog 在旧代码中
|
||||
* 不是 @Autowired 字段,而是 XML 注入。这里集中补齐,旧类零修改。
|
||||
*/
|
||||
@Configuration
|
||||
public class LegacyXmlWiring implements SmartInitializingSingleton {
|
||||
|
||||
private final POJOCRUDServiceImpl pojoCRUDService;
|
||||
private final POJOServiceImpl pojoService;
|
||||
private final SystemLogManager systemLogManager;
|
||||
private final DataOperatorLog dataOperatorLog;
|
||||
|
||||
public LegacyXmlWiring(POJOCRUDServiceImpl pojoCRUDService,
|
||||
POJOServiceImpl pojoService,
|
||||
SystemLogManager systemLogManager,
|
||||
DataOperatorLog dataOperatorLog) {
|
||||
this.pojoCRUDService = pojoCRUDService;
|
||||
this.pojoService = pojoService;
|
||||
this.systemLogManager = systemLogManager;
|
||||
this.dataOperatorLog = dataOperatorLog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterSingletonsInstantiated() {
|
||||
pojoCRUDService.setSystemLogManager(systemLogManager);
|
||||
pojoService.setSystemLogManager(systemLogManager);
|
||||
pojoService.setDataOperatorLog(dataOperatorLog);
|
||||
}
|
||||
|
||||
/** 引擎字段值含 joda DateTime(CREATETIME 等),Boot 3 需显式注册序列化模块。 */
|
||||
@Bean
|
||||
public JodaModule jodaModule() {
|
||||
return new JodaModule();
|
||||
}
|
||||
}
|
||||
19
platform-app/src/main/resources/application.yml
Normal file
19
platform-app/src/main/resources/application.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
spring:
|
||||
application:
|
||||
name: eip4-poc
|
||||
datasource:
|
||||
url: jdbc:postgresql://192.168.20.68:5435/postgres?currentSchema=eip3
|
||||
username: ceshi
|
||||
password: ceshi
|
||||
hikari:
|
||||
maximum-pool-size: 5
|
||||
# PoC 阶段对共享测试库默认只读,对拍写操作需显式改 false
|
||||
read-only: false
|
||||
|
||||
server:
|
||||
port: 8084
|
||||
|
||||
logging:
|
||||
level:
|
||||
com.dsasp: DEBUG
|
||||
org.springframework.jdbc.core: DEBUG
|
||||
32
platform-app/src/main/resources/static/amis.html
Normal file
32
platform-app/src/main/resources/static/amis.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>eip4-poc · amis 渲染验证</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<!-- amis SDK 锁定 6.13.0(与存档 schema.json 同版本) -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/amis@6.13.0/sdk/sdk.css"/>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/amis@6.13.0/sdk/helper.css"/>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/amis@6.13.0/sdk/iconfont.css"/>
|
||||
<script src="https://cdn.jsdelivr.net/npm/amis@6.13.0/sdk/sdk.js"></script>
|
||||
<style>html,body,#root{height:100%;margin:0}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script>
|
||||
(function () {
|
||||
const params = new URLSearchParams(location.search);
|
||||
const template = params.get('template') || '角色维护';
|
||||
fetch('/api/poc/amis-schema?template=' + encodeURIComponent(template))
|
||||
.then(r => r.json())
|
||||
.then(schema => {
|
||||
const amis = amisRequire('amis/embed');
|
||||
amis.embed('#root', schema);
|
||||
})
|
||||
.catch(e => {
|
||||
document.getElementById('root').innerText = '加载 schema 失败: ' + e;
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.eip4.platform.app;
|
||||
|
||||
import com.tngtech.archunit.junit.AnalyzeClasses;
|
||||
import com.tngtech.archunit.junit.ArchTest;
|
||||
import com.tngtech.archunit.lang.ArchRule;
|
||||
|
||||
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
|
||||
|
||||
/**
|
||||
* 架构纪律(《eip4-platform架构设计》第一节,ArchUnit 固化):
|
||||
* com.eip4.* 可调 com.dsasp.*,反向禁止——保真层不得感知现代层。
|
||||
*/
|
||||
@AnalyzeClasses(packages = {"com.dsasp", "com.eip4"})
|
||||
class ArchitectureRulesTest {
|
||||
|
||||
@ArchTest
|
||||
static final ArchRule 保真层禁止依赖现代层 =
|
||||
noClasses().that().resideInAPackage("com.dsasp..")
|
||||
.should().dependOnClassesThat().resideInAPackage("com.eip4..")
|
||||
.because("双层制:移植的旧代码不重写、不感知新代码,保证与 framework 源码 diff 最小");
|
||||
}
|
||||
Reference in New Issue
Block a user