1
mirror of https://github.com/CarmJos/UltraDepository.git synced 2026-06-04 16:48:21 +08:00

完善部分基础内容

This commit is contained in:
2021-12-21 07:26:09 +08:00
parent a1b2c02bb8
commit fc72bf2fe3
30 changed files with 1710 additions and 59 deletions
+19 -7
View File
@@ -2,12 +2,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<parent>
<artifactId>ultrabackpack-parent</artifactId>
<groupId>cc.carm.plugin</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ultrabackpack-api</artifactId>
<packaging>jar</packaging>
@@ -45,12 +53,16 @@
<url>https://github.com/CarmJos/UltraBackpack/actions/workflows/maven.yml</url>
</ciManagement>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<dependencies>
<dependency>
<groupId>cc.carm.lib</groupId>
<artifactId>easysql-api</artifactId>
<version>0.2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
@@ -0,0 +1,45 @@
package cc.carm.plugin.ultrabackpack.api.data;
import cc.carm.lib.easysql.api.SQLManager;
import java.sql.SQLException;
public enum DatabaseTables {
USER_DATA("ub_data", new String[]{
"`uuid` VARCHAR(36) NOT NULL PRIMARY KEY", // 用户的UUID
"`backpack` VARCHAR(32) NOT NULL",// 背包组名
"`type` VARCHAR(32) NOT NULL",// 背包内具体物品类型
"`amount` INT(11) NOT NULL DEFAULT 0", // 该物品的数量
"`sold` INT(11) NOT NULL DEFAULT 0", // 一周卖出次数
"`day` DATE NOT NULL", // 记录卖出数量的所在天
"PRIMARY KEY `data`(`uuid`,`backpack`,`type`)" // 联合主键索引
}),
;
String name;
String[] columns;
DatabaseTables(String name, String[] columns) {
this.name = name;
this.columns = columns;
}
public static void createTables(SQLManager sqlManager) throws SQLException {
for (DatabaseTables value : DatabaseTables.values()) {
sqlManager.createTable(value.getName())
.setColumns(value.getColumns())
.build().execute();
}
}
public String getName() {
return name;
}
public String[] getColumns() {
return columns;
}
}
@@ -0,0 +1,4 @@
package cc.carm.plugin.ultrabackpack.api.manager;
public interface UBUserManager {
}
@@ -0,0 +1,4 @@
package cc.carm.plugin.ultrabackpack.api.user;
public interface UBUserData {
}