This commit is contained in:
2026-08-28 23:01:52 +08:00
parent 969ff05815
commit da32a67d7f
107 changed files with 465 additions and 271 deletions
@@ -1,5 +1,6 @@
package com.baiyue.iam;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -9,7 +10,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 身份与权限服务启动入口,负责装配租户、成员、双端 RBAC 和授权快照相关组件。
*/
@MapperScan({"com.baiyue.iam.mapper", "com.baiyue.iam.notification.mapper"})
@MapperScan(basePackages = "com.baiyue.iam", annotationClass = Mapper.class)
@EnableFeignClients(basePackages = "com.baiyue.iam.client")
@EnableScheduling
@SpringBootApplication(scanBasePackages = "com.baiyue")
@@ -1,5 +1,6 @@
package com.baiyue.iam;
import org.apache.ibatis.annotations.Mapper;
import org.junit.jupiter.api.Test;
import org.mybatis.spring.annotation.MapperScan;
@@ -7,12 +8,11 @@ import static org.assertj.core.api.Assertions.assertThat;
class BaiyueIamApplicationContractTest {
@Test
void scansCoreAndNotificationMappers() {
void scansAnnotatedMappersFromTheStableServiceRoot() {
MapperScan mapperScan = BaiyueIamApplication.class.getAnnotation(MapperScan.class);
assertThat(mapperScan).isNotNull();
assertThat(mapperScan.value()).containsExactlyInAnyOrder(
"com.baiyue.iam.mapper",
"com.baiyue.iam.notification.mapper");
assertThat(mapperScan.basePackages()).containsExactly("com.baiyue.iam");
assertThat(mapperScan.annotationClass()).isEqualTo(Mapper.class);
}
}