Skip to content

Commit

Permalink
chore: 重新梳理了包和模块的结构
Browse files Browse the repository at this point in the history
  • Loading branch information
aruis committed Aug 2, 2024
1 parent a73f74f commit 4c85b3d
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 70 deletions.
16 changes: 0 additions & 16 deletions my-ability-uni/build.gradle

This file was deleted.

12 changes: 0 additions & 12 deletions my-ability/build.gradle

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.ximatai.muyun.ability;
package net.ximatai.muyun.ability.std;

import java.util.Map;
import java.util.StringJoiner;
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.ximatai.muyun.ability.uni;
package net.ximatai.muyun.ability.std.curd.uni;

public interface ICURDUniAbility extends ICreateAbilityUni {
}
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
package net.ximatai.muyun.database.standard;
package net.ximatai.muyun.database.std;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.persistence.EntityManager;
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;

import java.util.List;
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<String, Object> params) {
Expand Down
7 changes: 1 addition & 6 deletions my-database/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> params);

Expand Down
5 changes: 3 additions & 2 deletions my-platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 4c85b3d

Please sign in to comment.