diff --git a/.github/workflows/auto-check.yml b/.github/workflows/auto-check.yml index 6d6889a..428f934 100644 --- a/.github/workflows/auto-check.yml +++ b/.github/workflows/auto-check.yml @@ -1,5 +1,14 @@ name: check -on: pull_request +on: + pull_request: + paths: + - 'api/**' + - 'common/**' + - 'core/**' + - 'dao/**' + - 'plugin/**' + - 'gradle/**' + - 'config/**' jobs: checkstyle: diff --git a/README.md b/README.md index e8aaff3..000f5c2 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ - [ ] Word 2. 邮件通知 - [ ] 新增讨论 - - [ ] 版本变更 + - [x] 版本变更 ## 联系作者 diff --git a/core/build.gradle b/core/build.gradle index 7d03df8..7c3a4b6 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -38,5 +38,6 @@ dependencies { // test testImplementation "mysql:mysql-connector-java:${mysqlConnectorVersion}" testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.flywaydb:flyway-core' } diff --git a/core/src/test/java/com/databasir/core/BaseTest.java b/core/src/test/java/com/databasir/core/BaseTest.java index 443cfde..75bd72b 100644 --- a/core/src/test/java/com/databasir/core/BaseTest.java +++ b/core/src/test/java/com/databasir/core/BaseTest.java @@ -3,12 +3,10 @@ package com.databasir.core; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.jdbc.Sql; import org.springframework.test.context.junit.jupiter.SpringExtension; -@SpringBootTest(classes = CoreTestApplication.class) +@SpringBootTest(classes = CoreTestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.NONE) @ActiveProfiles("ut") @ExtendWith(SpringExtension.class) -@Sql({"classpath:sql/init.sql"}) public class BaseTest { } diff --git a/core/src/test/java/com/databasir/core/infrastructure/event/subscriber/DocumentEventSubscriberTest.java b/core/src/test/java/com/databasir/core/infrastructure/event/subscriber/DocumentEventSubscriberTest.java index 93807c5..d0b085d 100644 --- a/core/src/test/java/com/databasir/core/infrastructure/event/subscriber/DocumentEventSubscriberTest.java +++ b/core/src/test/java/com/databasir/core/infrastructure/event/subscriber/DocumentEventSubscriberTest.java @@ -31,7 +31,10 @@ class DocumentEventSubscriberTest extends BaseTest { } @Test - @Sql("classpath:/sql/event/subscriber/DocumentEventSubscriberTest.sql") + @Sql(scripts = { + "classpath:sql/event/subscriber/DocumentEventSubscriberTest.sql", + "classpath:sql/init.sql" + }) void onDocumentUpdated() { var event = new DocumentUpdated(); RootDiff diff = new RootDiff(); diff --git a/core/src/test/java/com/databasir/core/infrastructure/event/subscriber/UserEventSubscriberTest.java b/core/src/test/java/com/databasir/core/infrastructure/event/subscriber/UserEventSubscriberTest.java index df13add..08961dd 100644 --- a/core/src/test/java/com/databasir/core/infrastructure/event/subscriber/UserEventSubscriberTest.java +++ b/core/src/test/java/com/databasir/core/infrastructure/event/subscriber/UserEventSubscriberTest.java @@ -29,7 +29,10 @@ class UserEventSubscriberTest extends BaseTest { } @Test - @Sql("classpath:sql/event/subscriber/UserEventSubscriberTest.sql") + @Sql({ + "classpath:sql/event/subscriber/UserEventSubscriberTest.sql", + "classpath:sql/init.sql" + }) void onPasswordRenewed() { var event = UserPasswordRenewed.builder() .email("ut@databasir.com") @@ -43,7 +46,10 @@ class UserEventSubscriberTest extends BaseTest { } @Test - @Sql("classpath:sql/event/subscriber/UserEventSubscriberTest.sql") + @Sql({ + "classpath:sql/event/subscriber/UserEventSubscriberTest.sql", + "classpath:sql/init.sql" + }) void onUserCreated() { var event = UserCreated.builder() .username("ut") diff --git a/core/src/test/resources/sql/init.sql b/core/src/test/resources/sql/init.sql index b82c32f..dc77716 100644 --- a/core/src/test/resources/sql/init.sql +++ b/core/src/test/resources/sql/init.sql @@ -1,4 +1,3 @@ -# mail configuration REPLACE INTO databasir.sys_mail (id, username, password, smtp_host, smtp_port, use_ssl, update_at, create_at) VALUES (999, 'ut@databasir.com', '123456', 'smtp.exmail.databasir.com', 465, 1, '2022-03-25 03:14:27', '2022-03-21 14:20:56'); diff --git a/docs/README.md b/docs/README.md index 7deccf7..ae9518e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -## 简介 +## 简介 ![](databasir.png) 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。 @@ -13,7 +13,6 @@ | demo | demo123 | 系统管理员 | | dev | dev123 | 普通 | - ## 特性 1. 兼容市面多数数据库:支持所有拥有 JDBC 驱动的数据库,mysql、postgresql 开箱即用 @@ -33,7 +32,7 @@ - [ ] Word 2. 邮件通知 - [ ] 文档新增讨论 - - [ ] 文档版本变更 + - [x] 文档版本变更 ## 更多 diff --git a/docs/README/management-project/img/project-sync4.png b/docs/README/management-project/img/project-sync4.png new file mode 100644 index 0000000..b8f2e6e Binary files /dev/null and b/docs/README/management-project/img/project-sync4.png differ diff --git a/docs/README/management-project/index.md b/docs/README/management-project/index.md index 7519ed7..0826e34 100644 --- a/docs/README/management-project/index.md +++ b/docs/README/management-project/index.md @@ -99,7 +99,9 @@ ![](img/project-sync3.png) +如果有新的内容产生,那么该项目所属分组下的组员都将收到邮件通知 +![img.png](img/project-sync4.png) 在该页面仍可以点击同步按钮同步文档,**但 Databasir 会自动与当前最新版本的文档做对比,如果没有结构变更,不会创建新的版本内容。** diff --git a/docs/README/management-user/img/user-create4.png b/docs/README/management-user/img/user-create4.png new file mode 100644 index 0000000..2b6064c Binary files /dev/null and b/docs/README/management-user/img/user-create4.png differ diff --git a/docs/README/management-user/index.md b/docs/README/management-user/index.md index cb15b5d..bddd5f3 100644 --- a/docs/README/management-user/index.md +++ b/docs/README/management-user/index.md @@ -22,7 +22,9 @@ Databasir 目前不会校验邮箱的真实性,请确保邮箱填写正确 ![](img/user-create3.png) +如果已经配置了系统邮箱,那么新建账户对应的信息将通过邮件通知给用户 +![](img/user-create4.png) ## 用户详情