init: 尚数网平台 JNPF 7.0 兼容后端(多应用 + 面 A/面 B 双契约)
- axum 0.8 + pglite:12 张表,多应用按 App-Code 头解析 f_system_id 隔离 - 面 A(ssw/react 形状)+ 面 B(官方 JNPF 形状,Vue-Version: 3)双契约并存 - 业务模块 asset/DataResource;面 B 用户 CRUD 9 条已落地 - 六道闸门 + 两把运行时尺子(perm-smoke 43 / perm-smoke-jnpf 23) - scripts/:前端接口清单、页面依赖反查、运行时探针
This commit is contained in:
commit
9771fa844d
95 files changed
+30592
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package ssw;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
/**
|
||||
* ssw 标准 Spring Boot 启动入口(包名 ssw,类名 SswAdminApplication)。
|
||||
*
|
||||
* ⚠️ scanBasePackages 必须含 "ssw" — 否则 ssw.common.config.SswMapperConfig 等共享 bean 不会被 Spring 扫描到。
|
||||
* ⚠️ exclude = DataSourceAutoConfiguration.class — jnpf-common-database 自带数据源配置,
|
||||
* 不要让 Spring Boot 自动配置覆盖它。
|
||||
*
|
||||
* 业务模块 mapper 扫描由 {@link ssw.common.config.SswMapperConfig} 统一接管
|
||||
* (basePackages = "ssw.**.mapper"),不必在本类加 @MapperScan。
|
||||
*
|
||||
* 注:本模板**不**带 `@EnableFileStorage`(dromara x-file-storage,文件存储用)
|
||||
* 与 `jnpf.util.context.SpringContext`(Spring 容器提前初始化)这两个 starter — 用到时再加对应依赖。
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication(scanBasePackages = {"jnpf", "ssw"}, exclude = {DataSourceAutoConfiguration.class})
|
||||
public class SswAdminApplication extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SswAdminApplication.class, args);
|
||||
log.info("SswAdmin 启动完成");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package ssw.common.config;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* ssw 共享 MapperConfig — 所有 ssw.{appCode}.**.*.mapper 由这一个配置统一注册。
|
||||
*
|
||||
* ⚠️ 根因:JNPF 自带 MybatisPlusConfig @MapperScan 只扫 "jnpf.**.mapper" / "jnpf.mapper",
|
||||
* 不扫 ssw.**.mapper,导致所有 ssw-{app_code} 业务模块的 Mapper 接口无法被 Spring 注册为 bean,
|
||||
* 启动后报 java.lang.NoSuchBeanDefinitionException: No qualifying bean of type 'ssw.{app_code}.mapper.XxxMapper'。
|
||||
*
|
||||
* ✅ 单一解决方案:本文件统一处理 ssw.**.mapper — 任何新加 ssw-{app_code} 包都无需再单独写 MapperConfig。
|
||||
*
|
||||
* 跨子系统 Mapper 重名(多 ssw-{app_code} 都叫 ContractMapper)时,启用 nameGenerator
|
||||
* {@link SswMapperBeanNameGenerator} 给 bean 名加子系统前缀,从机制上避免冲突。
|
||||
* 本模板默认不启用 nameGenerator;按需在本 pom 加 ssw-common-biz 依赖或复制 SswMapperBeanNameGenerator。
|
||||
*/
|
||||
@Configuration
|
||||
@MapperScan(basePackages = "ssw.**.mapper")
|
||||
public class SswMapperConfig {
|
||||
}
|
||||
Reference in new issue
Block a user