From 4c85b3d8fd3620b8210455cb07048d3ee14c973d Mon Sep 17 00:00:00 2001 From: Liu Rui Date: Fri, 2 Aug 2024 11:31:56 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=87=8D=E6=96=B0=E6=A2=B3=E7=90=86?= =?UTF-8?q?=E4=BA=86=E5=8C=85=E5=92=8C=E6=A8=A1=E5=9D=97=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- my-ability-uni/build.gradle | 16 ---------------- my-ability/build.gradle | 12 ------------ .../ximatai/muyun/ability/IDatabaseAbility.java | 13 ------------- .../muyun/ability/std/IDatabaseAbility.java | 13 +++++++++++++ .../ability/{ => std}/IDatabaseUniAbility.java | 2 +- .../ability/{ => std}/IMetadataAbility.java | 2 +- .../ability/std/curd/std}/ICURDAbility.java | 2 +- .../ability/std/curd/std}/ICreateAbility.java | 4 +++- .../ability/std/curd/std}/IDeleteAbility.java | 4 +++- .../ability/std/curd/std}/ISelectAbility.java | 4 +++- .../ability/std/curd/std}/IUpdateAbility.java | 4 +++- .../ability/std/curd}/uni/ICURDUniAbility.java | 2 +- .../ability/std/curd}/uni/ICreateAbilityUni.java | 6 +++--- .../build.gradle | 1 + .../muyun/database/std/DataAccessStd.java | 9 ++++----- my-database/build.gradle | 7 +------ ...cessStandard.java => IDatabaseAccessStd.java} | 2 +- my-platform/build.gradle | 5 +++-- .../platform/controller/ModuleController.java | 2 +- settings.gradle | 6 +++--- 20 files changed, 46 insertions(+), 70 deletions(-) delete mode 100644 my-ability-uni/build.gradle delete mode 100644 my-ability/build.gradle delete mode 100644 my-core/src/main/java/net/ximatai/muyun/ability/IDatabaseAbility.java create mode 100644 my-core/src/main/java/net/ximatai/muyun/ability/std/IDatabaseAbility.java rename my-core/src/main/java/net/ximatai/muyun/ability/{ => std}/IDatabaseUniAbility.java (88%) rename my-core/src/main/java/net/ximatai/muyun/ability/{ => std}/IMetadataAbility.java (96%) rename {my-ability/src/main/java/net/ximatai/muyun/ability => my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std}/ICURDAbility.java (68%) rename {my-ability/src/main/java/net/ximatai/muyun/ability => my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std}/ICreateAbility.java (65%) rename {my-ability/src/main/java/net/ximatai/muyun/ability => my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std}/IDeleteAbility.java (79%) rename {my-ability/src/main/java/net/ximatai/muyun/ability => my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std}/ISelectAbility.java (70%) rename {my-ability/src/main/java/net/ximatai/muyun/ability => my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std}/IUpdateAbility.java (80%) rename {my-ability-uni/src/main/java/net/ximatai/muyun/ability => my-core/src/main/java/net/ximatai/muyun/ability/std/curd}/uni/ICURDUniAbility.java (57%) rename {my-ability-uni/src/main/java/net/ximatai/muyun/ability => my-core/src/main/java/net/ximatai/muyun/ability/std/curd}/uni/ICreateAbilityUni.java (67%) rename {my-database-standard => my-database-std}/build.gradle (89%) rename my-database-standard/src/main/java/net/ximatai/muyun/database/standard/DataAccess.java => my-database-std/src/main/java/net/ximatai/muyun/database/std/DataAccessStd.java (92%) rename my-database/src/main/java/net/ximatai/muyun/database/{IDatabaseAccessStandard.java => IDatabaseAccessStd.java} (88%) diff --git a/my-ability-uni/build.gradle b/my-ability-uni/build.gradle deleted file mode 100644 index 45f7799b..00000000 --- a/my-ability-uni/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -plugins { - id 'java' - id 'java-library' - id 'checkstyle' - id 'configure-jandex' -} - - -dependencies { - api enforcedPlatform(libs.quarkus.platform.bom) - -// api project(':my-ability') - api project(':my-core') -// api project(':my-database-uni') - -} diff --git a/my-ability/build.gradle b/my-ability/build.gradle deleted file mode 100644 index ecf67063..00000000 --- a/my-ability/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id 'java' - id 'java-library' - id 'checkstyle' - id 'configure-jandex' -} - - -dependencies { - api enforcedPlatform(libs.quarkus.platform.bom) - api project(':my-core') -} diff --git a/my-core/src/main/java/net/ximatai/muyun/ability/IDatabaseAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/IDatabaseAbility.java deleted file mode 100644 index b013411e..00000000 --- a/my-core/src/main/java/net/ximatai/muyun/ability/IDatabaseAbility.java +++ /dev/null @@ -1,13 +0,0 @@ -package net.ximatai.muyun.ability; - -import net.ximatai.muyun.database.IDatabaseAccess; -import net.ximatai.muyun.database.IDatabaseAccessStandard; - -public interface IDatabaseAbility { - - IDatabaseAccess getDatabaseAccess(); - - default IDatabaseAccessStandard getDatabase() { - return (IDatabaseAccessStandard) getDatabaseAccess(); - } -} diff --git a/my-core/src/main/java/net/ximatai/muyun/ability/std/IDatabaseAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/IDatabaseAbility.java new file mode 100644 index 00000000..202f1573 --- /dev/null +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/IDatabaseAbility.java @@ -0,0 +1,13 @@ +package net.ximatai.muyun.ability.std; + +import net.ximatai.muyun.database.IDatabaseAccess; +import net.ximatai.muyun.database.IDatabaseAccessStd; + +public interface IDatabaseAbility { + + IDatabaseAccess getDatabaseAccess(); + + default IDatabaseAccessStd getDatabase() { + return (IDatabaseAccessStd) getDatabaseAccess(); + } +} diff --git a/my-core/src/main/java/net/ximatai/muyun/ability/IDatabaseUniAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/IDatabaseUniAbility.java similarity index 88% rename from my-core/src/main/java/net/ximatai/muyun/ability/IDatabaseUniAbility.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/IDatabaseUniAbility.java index 8ecfbd05..ff57ddc6 100644 --- a/my-core/src/main/java/net/ximatai/muyun/ability/IDatabaseUniAbility.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/IDatabaseUniAbility.java @@ -1,4 +1,4 @@ -package net.ximatai.muyun.ability; +package net.ximatai.muyun.ability.std; import net.ximatai.muyun.database.IDatabaseAccess; import net.ximatai.muyun.database.IDatabaseAccessUni; diff --git a/my-core/src/main/java/net/ximatai/muyun/ability/IMetadataAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/IMetadataAbility.java similarity index 96% rename from my-core/src/main/java/net/ximatai/muyun/ability/IMetadataAbility.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/IMetadataAbility.java index b5f709f5..71e49f0c 100644 --- a/my-core/src/main/java/net/ximatai/muyun/ability/IMetadataAbility.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/IMetadataAbility.java @@ -1,4 +1,4 @@ -package net.ximatai.muyun.ability; +package net.ximatai.muyun.ability.std; import java.util.Map; import java.util.StringJoiner; diff --git a/my-ability/src/main/java/net/ximatai/muyun/ability/ICURDAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ICURDAbility.java similarity index 68% rename from my-ability/src/main/java/net/ximatai/muyun/ability/ICURDAbility.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ICURDAbility.java index 433d06c7..131d405f 100644 --- a/my-ability/src/main/java/net/ximatai/muyun/ability/ICURDAbility.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ICURDAbility.java @@ -1,4 +1,4 @@ -package net.ximatai.muyun.ability; +package net.ximatai.muyun.ability.std.curd.std; public interface ICURDAbility extends ICreateAbility, IUpdateAbility, IDeleteAbility, ISelectAbility { } diff --git a/my-ability/src/main/java/net/ximatai/muyun/ability/ICreateAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ICreateAbility.java similarity index 65% rename from my-ability/src/main/java/net/ximatai/muyun/ability/ICreateAbility.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ICreateAbility.java index 94e4893d..51ed1c5a 100644 --- a/my-ability/src/main/java/net/ximatai/muyun/ability/ICreateAbility.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ICreateAbility.java @@ -1,7 +1,9 @@ -package net.ximatai.muyun.ability; +package net.ximatai.muyun.ability.std.curd.std; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; +import net.ximatai.muyun.ability.std.IDatabaseAbility; +import net.ximatai.muyun.ability.std.IMetadataAbility; import java.util.Map; diff --git a/my-ability/src/main/java/net/ximatai/muyun/ability/IDeleteAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/IDeleteAbility.java similarity index 79% rename from my-ability/src/main/java/net/ximatai/muyun/ability/IDeleteAbility.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/IDeleteAbility.java index d93a63d0..1dbda70b 100644 --- a/my-ability/src/main/java/net/ximatai/muyun/ability/IDeleteAbility.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/IDeleteAbility.java @@ -1,9 +1,11 @@ -package net.ximatai.muyun.ability; +package net.ximatai.muyun.ability.std.curd.std; import jakarta.transaction.Transactional; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.PathParam; +import net.ximatai.muyun.ability.std.IDatabaseAbility; +import net.ximatai.muyun.ability.std.IMetadataAbility; import net.ximatai.muyun.database.exception.MyDatabaseException; import java.util.Map; diff --git a/my-ability/src/main/java/net/ximatai/muyun/ability/ISelectAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ISelectAbility.java similarity index 70% rename from my-ability/src/main/java/net/ximatai/muyun/ability/ISelectAbility.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ISelectAbility.java index b797c93e..ee04a0ab 100644 --- a/my-ability/src/main/java/net/ximatai/muyun/ability/ISelectAbility.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/ISelectAbility.java @@ -1,8 +1,10 @@ -package net.ximatai.muyun.ability; +package net.ximatai.muyun.ability.std.curd.std; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.PathParam; +import net.ximatai.muyun.ability.std.IDatabaseAbility; +import net.ximatai.muyun.ability.std.IMetadataAbility; import java.util.Map; diff --git a/my-ability/src/main/java/net/ximatai/muyun/ability/IUpdateAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/IUpdateAbility.java similarity index 80% rename from my-ability/src/main/java/net/ximatai/muyun/ability/IUpdateAbility.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/IUpdateAbility.java index f531d8d6..d610fc09 100644 --- a/my-ability/src/main/java/net/ximatai/muyun/ability/IUpdateAbility.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/std/IUpdateAbility.java @@ -1,9 +1,11 @@ -package net.ximatai.muyun.ability; +package net.ximatai.muyun.ability.std.curd.std; import jakarta.transaction.Transactional; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; import jakarta.ws.rs.PathParam; +import net.ximatai.muyun.ability.std.IDatabaseAbility; +import net.ximatai.muyun.ability.std.IMetadataAbility; import net.ximatai.muyun.database.exception.MyDatabaseException; import java.util.Map; diff --git a/my-ability-uni/src/main/java/net/ximatai/muyun/ability/uni/ICURDUniAbility.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/uni/ICURDUniAbility.java similarity index 57% rename from my-ability-uni/src/main/java/net/ximatai/muyun/ability/uni/ICURDUniAbility.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/curd/uni/ICURDUniAbility.java index f2192151..0f3afb51 100644 --- a/my-ability-uni/src/main/java/net/ximatai/muyun/ability/uni/ICURDUniAbility.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/uni/ICURDUniAbility.java @@ -1,4 +1,4 @@ -package net.ximatai.muyun.ability.uni; +package net.ximatai.muyun.ability.std.curd.uni; public interface ICURDUniAbility extends ICreateAbilityUni { } diff --git a/my-ability-uni/src/main/java/net/ximatai/muyun/ability/uni/ICreateAbilityUni.java b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/uni/ICreateAbilityUni.java similarity index 67% rename from my-ability-uni/src/main/java/net/ximatai/muyun/ability/uni/ICreateAbilityUni.java rename to my-core/src/main/java/net/ximatai/muyun/ability/std/curd/uni/ICreateAbilityUni.java index e5442b04..5bfd051c 100644 --- a/my-ability-uni/src/main/java/net/ximatai/muyun/ability/uni/ICreateAbilityUni.java +++ b/my-core/src/main/java/net/ximatai/muyun/ability/std/curd/uni/ICreateAbilityUni.java @@ -1,10 +1,10 @@ -package net.ximatai.muyun.ability.uni; +package net.ximatai.muyun.ability.std.curd.uni; import io.smallrye.mutiny.Uni; import jakarta.ws.rs.POST; import jakarta.ws.rs.Path; -import net.ximatai.muyun.ability.IDatabaseUniAbility; -import net.ximatai.muyun.ability.IMetadataAbility; +import net.ximatai.muyun.ability.std.IDatabaseUniAbility; +import net.ximatai.muyun.ability.std.IMetadataAbility; import java.util.Map; diff --git a/my-database-standard/build.gradle b/my-database-std/build.gradle similarity index 89% rename from my-database-standard/build.gradle rename to my-database-std/build.gradle index 0f680dad..74b90905 100644 --- a/my-database-standard/build.gradle +++ b/my-database-std/build.gradle @@ -10,6 +10,7 @@ dependencies { api enforcedPlatform(libs.quarkus.platform.bom) implementation project(':my-database') + api "io.quarkus:quarkus-agroal" api "io.quarkus:quarkus-hibernate-orm" api "io.quarkus:quarkus-jdbc-postgresql" } diff --git a/my-database-standard/src/main/java/net/ximatai/muyun/database/standard/DataAccess.java b/my-database-std/src/main/java/net/ximatai/muyun/database/std/DataAccessStd.java similarity index 92% rename from my-database-standard/src/main/java/net/ximatai/muyun/database/standard/DataAccess.java rename to my-database-std/src/main/java/net/ximatai/muyun/database/std/DataAccessStd.java index ec220cf2..97f08402 100644 --- a/my-database-standard/src/main/java/net/ximatai/muyun/database/standard/DataAccess.java +++ b/my-database-std/src/main/java/net/ximatai/muyun/database/std/DataAccessStd.java @@ -1,4 +1,4 @@ -package net.ximatai.muyun.database.standard; +package net.ximatai.muyun.database.std; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -6,7 +6,7 @@ import jakarta.persistence.Query; import jakarta.persistence.Tuple; import jakarta.transaction.Transactional; -import net.ximatai.muyun.database.IDatabaseAccessStandard; +import net.ximatai.muyun.database.IDatabaseAccessStd; import net.ximatai.muyun.database.exception.MyDatabaseException; import net.ximatai.muyun.database.tool.TupleTool; @@ -14,12 +14,11 @@ import java.util.Map; @ApplicationScoped -public class DataAccess implements IDatabaseAccessStandard { +public class DataAccessStd implements IDatabaseAccessStd { @Inject EntityManager entityManager; - - + //TODO 要审查params的内容类型,比如字符串的日期要做转化,才能入库 @Override public String insert(String sql, Map params) { diff --git a/my-database/build.gradle b/my-database/build.gradle index 56e40375..51b0a6f8 100644 --- a/my-database/build.gradle +++ b/my-database/build.gradle @@ -6,12 +6,7 @@ plugins { dependencies { - api enforcedPlatform(libs.quarkus.platform.bom) -// implementation project(':my-core') -// implementation project(':my-core-uni') - - - + compileOnlyApi enforcedPlatform(libs.quarkus.platform.bom) compileOnlyApi "io.quarkus:quarkus-hibernate-reactive-panache" } diff --git a/my-database/src/main/java/net/ximatai/muyun/database/IDatabaseAccessStandard.java b/my-database/src/main/java/net/ximatai/muyun/database/IDatabaseAccessStd.java similarity index 88% rename from my-database/src/main/java/net/ximatai/muyun/database/IDatabaseAccessStandard.java rename to my-database/src/main/java/net/ximatai/muyun/database/IDatabaseAccessStd.java index 44ef90df..36dad917 100644 --- a/my-database/src/main/java/net/ximatai/muyun/database/IDatabaseAccessStandard.java +++ b/my-database/src/main/java/net/ximatai/muyun/database/IDatabaseAccessStd.java @@ -3,7 +3,7 @@ import java.util.List; import java.util.Map; -public interface IDatabaseAccessStandard extends IDatabaseAccess { +public interface IDatabaseAccessStd extends IDatabaseAccess { String insert(String sql, Map params); diff --git a/my-platform/build.gradle b/my-platform/build.gradle index df009210..0ce7ca11 100644 --- a/my-platform/build.gradle +++ b/my-platform/build.gradle @@ -8,7 +8,8 @@ plugins { dependencies { implementation project(':my-core') // implementation project(':my-ability') -// implementation project(':my-database-standard') - implementation project(':my-ability-uni') +// implementation project(':my-database-std') +// implementation project(':my-ability') +// implementation project(':my-database-std') implementation project(':my-database-uni') } diff --git a/my-platform/src/main/java/net/ximatai/muyun/platform/controller/ModuleController.java b/my-platform/src/main/java/net/ximatai/muyun/platform/controller/ModuleController.java index c1c2bcbe..a7679895 100644 --- a/my-platform/src/main/java/net/ximatai/muyun/platform/controller/ModuleController.java +++ b/my-platform/src/main/java/net/ximatai/muyun/platform/controller/ModuleController.java @@ -2,7 +2,7 @@ import jakarta.inject.Inject; import jakarta.ws.rs.Path; -import net.ximatai.muyun.ability.uni.ICURDUniAbility; +import net.ximatai.muyun.ability.std.curd.uni.ICURDUniAbility; import net.ximatai.muyun.database.IDatabaseAccess; @Path("/module") diff --git a/settings.gradle b/settings.gradle index bff07640..51c02234 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,11 +8,11 @@ assert JavaVersion.current() >= JavaVersion.VERSION_21: "You must use at least Java 21 to build the project, you're currently using ${System.getProperty("java.version")}" include 'my-core' -include 'my-ability' -include 'my-ability-uni' +//include 'my-ability' +//include 'my-ability-uni' include 'my-platform' include 'my-database' -include 'my-database-standard' +include 'my-database-std' include 'my-database-uni' //include 'my-msg' include 'my-boot'