commit 0734357d2af5d031edb26fa514f9570bb7a98fd0 Author: database-mysql Date: Thu Jan 1 13:46:21 2026 +0800 New diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3b41682 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/mvnw text eol=lf +*.cmd text eol=crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..667aaef --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..919ce1f --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..5f22861 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml new file mode 100644 index 0000000..fc56c4b --- /dev/null +++ b/.idea/dataSources.local.xml @@ -0,0 +1,23 @@ + + + + + + #@ + ` + true + + + master_key + root + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..addd8f8 --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,17 @@ + + + + + mysql.8 + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://10.168.2.2:3306/ + + + + + + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/.idea/dataSources/b2cbac2a-802b-4f34-bcd7-5cd59870c776.xml b/.idea/dataSources/b2cbac2a-802b-4f34-bcd7-5cd59870c776.xml new file mode 100644 index 0000000..dc0363d --- /dev/null +++ b/.idea/dataSources/b2cbac2a-802b-4f34-bcd7-5cd59870c776.xml @@ -0,0 +1,1433 @@ + + + + + lower/lower + InnoDB + InnoDB + |root||administrator||ALTER|G +|root||azure||ALTER|G +|root||root|10.168.%|ALTER|G +|root||administrator||ALTER ROUTINE|G +|root||azure||ALTER ROUTINE|G +|root||root|10.168.%|ALTER ROUTINE|G +|root||administrator||CREATE|G +|root||azure||CREATE|G +|root||root|10.168.%|CREATE|G +|root||administrator||CREATE ROUTINE|G +|root||azure||CREATE ROUTINE|G +|root||root|10.168.%|CREATE ROUTINE|G +|root||administrator||CREATE TABLESPACE|G +|root||azure||CREATE TABLESPACE|G +|root||root|10.168.%|CREATE TABLESPACE|G +|root||administrator||CREATE TEMPORARY TABLES|G +|root||azure||CREATE TEMPORARY TABLES|G +|root||root|10.168.%|CREATE TEMPORARY TABLES|G +|root||administrator||CREATE USER|G +|root||azure||CREATE USER|G +|root||root|10.168.%|CREATE USER|G +|root||administrator||CREATE VIEW|G +|root||azure||CREATE VIEW|G +|root||root|10.168.%|CREATE VIEW|G +|root||administrator||DELETE|G +|root||azure||DELETE|G +|root||root|10.168.%|DELETE|G +|root||administrator||DROP|G +|root||azure||DROP|G +|root||root|10.168.%|DROP|G +|root||administrator||EVENT|G +|root||azure||EVENT|G +|root||root|10.168.%|EVENT|G +|root||administrator||EXECUTE|G +|root||azure||EXECUTE|G +|root||root|10.168.%|EXECUTE|G +|root||administrator||FILE|G +|root||azure||FILE|G +|root||root|10.168.%|FILE|G +|root||administrator||INDEX|G +|root||azure||INDEX|G +|root||root|10.168.%|INDEX|G +|root||administrator||INSERT|G +|root||azure||INSERT|G +|root||root|10.168.%|INSERT|G +|root||administrator||LOCK TABLES|G +|root||azure||LOCK TABLES|G +|root||root|10.168.%|LOCK TABLES|G +|root||mysql.session|localhost|PERSIST_RO_VARIABLES_ADMIN|G +|root||administrator||PROCESS|G +|root||azure||PROCESS|G +|root||root|10.168.%|PROCESS|G +|root||administrator||REFERENCES|G +|root||azure||REFERENCES|G +|root||root|10.168.%|REFERENCES|G +|root||administrator||RELOAD|G +|root||azure||RELOAD|G +|root||root|10.168.%|RELOAD|G +|root||administrator||REPLICATION CLIENT|G +|root||azure||REPLICATION CLIENT|G +|root||root|10.168.%|REPLICATION CLIENT|G +|root||administrator||REPLICATION SLAVE|G +|root||azure||REPLICATION SLAVE|G +|root||root|10.168.%|REPLICATION SLAVE|G +|root||administrator||SELECT|G +|root||azure||SELECT|G +|root||mysql.infoschema|localhost|SELECT|G +|root||root|10.168.%|SELECT|G +|root||administrator||SHOW DATABASES|G +|root||azure||SHOW DATABASES|G +|root||root|10.168.%|SHOW DATABASES|G +|root||administrator||SHOW VIEW|G +|root||azure||SHOW VIEW|G +|root||root|10.168.%|SHOW VIEW|G +|root||administrator||SHUTDOWN|G +|root||azure||SHUTDOWN|G +|root||root|10.168.%|SHUTDOWN|G +|root||administrator||SUPER|G +|root||azure||SUPER|G +|root||mysql.session|localhost|SUPER|G +|root||root|10.168.%|SUPER|G +|root||mysql.session|localhost|SYSTEM_VARIABLES_ADMIN|G +|root||administrator||TRIGGER|G +|root||azure||TRIGGER|G +|root||root|10.168.%|TRIGGER|G +|root||administrator||UPDATE|G +|root||azure||UPDATE|G +|root||root|10.168.%|UPDATE|G +|root||administrator||grant option|G +|root||azure||grant option|G +|root||root|10.168.%|grant option|G +%|schema||administrator||ALTER|G +%|schema||azure||ALTER|G +%|schema||administrator||ALTER ROUTINE|G +%|schema||azure||ALTER ROUTINE|G +%|schema||administrator||CREATE|G +%|schema||azure||CREATE|G +%|schema||administrator||CREATE ROUTINE|G +%|schema||azure||CREATE ROUTINE|G +%|schema||administrator||CREATE TEMPORARY TABLES|G +%|schema||azure||CREATE TEMPORARY TABLES|G +%|schema||administrator||CREATE VIEW|G +%|schema||azure||CREATE VIEW|G +%|schema||administrator||DELETE|G +%|schema||azure||DELETE|G +%|schema||administrator||DROP|G +%|schema||azure||DROP|G +%|schema||administrator||EVENT|G +%|schema||azure||EVENT|G +%|schema||administrator||EXECUTE|G +%|schema||azure||EXECUTE|G +%|schema||administrator||INDEX|G +%|schema||azure||INDEX|G +%|schema||administrator||INSERT|G +%|schema||azure||INSERT|G +%|schema||administrator||LOCK TABLES|G +%|schema||azure||LOCK TABLES|G +%|schema||administrator||REFERENCES|G +%|schema||azure||REFERENCES|G +%|schema||administrator||SELECT|G +%|schema||azure||SELECT|G +%|schema||administrator||SHOW VIEW|G +%|schema||azure||SHOW VIEW|G +%|schema||administrator||TRIGGER|G +%|schema||azure||TRIGGER|G +%|schema||administrator||UPDATE|G +%|schema||azure||UPDATE|G +%|schema||administrator||grant option|G +%|schema||azure||grant option|G +111|schema||333|localhost|ALTER|G +111|schema||333|localhost|ALTER ROUTINE|G +111|schema||333|localhost|CREATE|G +111|schema||333|localhost|CREATE ROUTINE|G +111|schema||333|localhost|CREATE TEMPORARY TABLES|G +111|schema||333|localhost|CREATE VIEW|G +111|schema||333|localhost|DELETE|G +111|schema||333|localhost|DROP|G +111|schema||333|localhost|EVENT|G +111|schema||333|localhost|EXECUTE|G +111|schema||333|localhost|INDEX|G +111|schema||333|localhost|INSERT|G +111|schema||333|localhost|LOCK TABLES|G +111|schema||333|localhost|REFERENCES|G +111|schema||333|localhost|SELECT|G +111|schema||333|localhost|SHOW VIEW|G +111|schema||333|localhost|TRIGGER|G +111|schema||333|localhost|UPDATE|G +121121|schema||111|localhost|ALTER|G +121121|schema||demo|localhost|ALTER|G +121121|schema||111|localhost|ALTER ROUTINE|G +121121|schema||demo|localhost|ALTER ROUTINE|G +121121|schema||111|localhost|CREATE|G +121121|schema||demo|localhost|CREATE|G +121121|schema||111|localhost|CREATE ROUTINE|G +121121|schema||demo|localhost|CREATE ROUTINE|G +121121|schema||111|localhost|CREATE TEMPORARY TABLES|G +121121|schema||demo|localhost|CREATE TEMPORARY TABLES|G +121121|schema||111|localhost|CREATE VIEW|G +121121|schema||demo|localhost|CREATE VIEW|G +121121|schema||111|localhost|DELETE|G +121121|schema||demo|localhost|DELETE|G +121121|schema||111|localhost|DROP|G +121121|schema||demo|localhost|DROP|G +121121|schema||111|localhost|EVENT|G +121121|schema||demo|localhost|EVENT|G +121121|schema||111|localhost|EXECUTE|G +121121|schema||demo|localhost|EXECUTE|G +121121|schema||111|localhost|INDEX|G +121121|schema||demo|localhost|INDEX|G +121121|schema||111|localhost|INSERT|G +121121|schema||demo|localhost|INSERT|G +121121|schema||111|localhost|LOCK TABLES|G +121121|schema||demo|localhost|LOCK TABLES|G +121121|schema||111|localhost|REFERENCES|G +121121|schema||demo|localhost|REFERENCES|G +121121|schema||111|localhost|SELECT|G +121121|schema||demo|localhost|SELECT|G +121121|schema||111|localhost|SHOW VIEW|G +121121|schema||demo|localhost|SHOW VIEW|G +121121|schema||111|localhost|TRIGGER|G +121121|schema||demo|localhost|TRIGGER|G +121121|schema||111|localhost|UPDATE|G +121121|schema||demo|localhost|UPDATE|G +demo|schema||111|localhost|ALTER|G +demo|schema||222|localhost|ALTER|G +demo|schema||demo|localhost|ALTER|G +demo|schema||111|localhost|ALTER ROUTINE|G +demo|schema||222|localhost|ALTER ROUTINE|G +demo|schema||demo|localhost|ALTER ROUTINE|G +demo|schema||111|localhost|CREATE|G +demo|schema||222|localhost|CREATE|G +demo|schema||demo|localhost|CREATE|G +demo|schema||111|localhost|CREATE ROUTINE|G +demo|schema||222|localhost|CREATE ROUTINE|G +demo|schema||demo|localhost|CREATE ROUTINE|G +demo|schema||111|localhost|CREATE TEMPORARY TABLES|G +demo|schema||222|localhost|CREATE TEMPORARY TABLES|G +demo|schema||demo|localhost|CREATE TEMPORARY TABLES|G +demo|schema||111|localhost|CREATE VIEW|G +demo|schema||222|localhost|CREATE VIEW|G +demo|schema||demo|localhost|CREATE VIEW|G +demo|schema||111|localhost|DELETE|G +demo|schema||222|localhost|DELETE|G +demo|schema||demo|localhost|DELETE|G +demo|schema||111|localhost|DROP|G +demo|schema||222|localhost|DROP|G +demo|schema||demo|localhost|DROP|G +demo|schema||111|localhost|EVENT|G +demo|schema||222|localhost|EVENT|G +demo|schema||demo|localhost|EVENT|G +demo|schema||111|localhost|EXECUTE|G +demo|schema||222|localhost|EXECUTE|G +demo|schema||demo|localhost|EXECUTE|G +demo|schema||111|localhost|INDEX|G +demo|schema||222|localhost|INDEX|G +demo|schema||demo|localhost|INDEX|G +demo|schema||111|localhost|INSERT|G +demo|schema||222|localhost|INSERT|G +demo|schema||demo|localhost|INSERT|G +demo|schema||111|localhost|LOCK TABLES|G +demo|schema||222|localhost|LOCK TABLES|G +demo|schema||demo|localhost|LOCK TABLES|G +demo|schema||111|localhost|REFERENCES|G +demo|schema||222|localhost|REFERENCES|G +demo|schema||demo|localhost|REFERENCES|G +demo|schema||111|localhost|SELECT|G +demo|schema||222|localhost|SELECT|G +demo|schema||demo|localhost|SELECT|G +demo|schema||111|localhost|SHOW VIEW|G +demo|schema||222|localhost|SHOW VIEW|G +demo|schema||demo|localhost|SHOW VIEW|G +demo|schema||111|localhost|TRIGGER|G +demo|schema||222|localhost|TRIGGER|G +demo|schema||demo|localhost|TRIGGER|G +demo|schema||111|localhost|UPDATE|G +demo|schema||222|localhost|UPDATE|G +demo|schema||demo|localhost|UPDATE|G +demo1|schema||1111|localhost|ALTER|G +demo1|schema||damin|localhost|ALTER|G +demo1|schema||demo1|localhost|ALTER|G +demo1|schema||1111|localhost|ALTER ROUTINE|G +demo1|schema||damin|localhost|ALTER ROUTINE|G +demo1|schema||demo1|localhost|ALTER ROUTINE|G +demo1|schema||1111|localhost|CREATE|G +demo1|schema||damin|localhost|CREATE|G +demo1|schema||demo1|localhost|CREATE|G +demo1|schema||1111|localhost|CREATE ROUTINE|G +demo1|schema||damin|localhost|CREATE ROUTINE|G +demo1|schema||demo1|localhost|CREATE ROUTINE|G +demo1|schema||1111|localhost|CREATE TEMPORARY TABLES|G +demo1|schema||damin|localhost|CREATE TEMPORARY TABLES|G +demo1|schema||demo1|localhost|CREATE TEMPORARY TABLES|G +demo1|schema||1111|localhost|CREATE VIEW|G +demo1|schema||damin|localhost|CREATE VIEW|G +demo1|schema||demo1|localhost|CREATE VIEW|G +demo1|schema||1111|localhost|DELETE|G +demo1|schema||damin|localhost|DELETE|G +demo1|schema||demo1|localhost|DELETE|G +demo1|schema||1111|localhost|DROP|G +demo1|schema||damin|localhost|DROP|G +demo1|schema||demo1|localhost|DROP|G +demo1|schema||1111|localhost|EVENT|G +demo1|schema||damin|localhost|EVENT|G +demo1|schema||demo1|localhost|EVENT|G +demo1|schema||1111|localhost|EXECUTE|G +demo1|schema||damin|localhost|EXECUTE|G +demo1|schema||demo1|localhost|EXECUTE|G +demo1|schema||1111|localhost|INDEX|G +demo1|schema||damin|localhost|INDEX|G +demo1|schema||demo1|localhost|INDEX|G +demo1|schema||1111|localhost|INSERT|G +demo1|schema||damin|localhost|INSERT|G +demo1|schema||demo1|localhost|INSERT|G +demo1|schema||1111|localhost|LOCK TABLES|G +demo1|schema||damin|localhost|LOCK TABLES|G +demo1|schema||demo1|localhost|LOCK TABLES|G +demo1|schema||1111|localhost|REFERENCES|G +demo1|schema||damin|localhost|REFERENCES|G +demo1|schema||demo1|localhost|REFERENCES|G +demo1|schema||1111|localhost|SELECT|G +demo1|schema||damin|localhost|SELECT|G +demo1|schema||demo1|localhost|SELECT|G +demo1|schema||1111|localhost|SHOW VIEW|G +demo1|schema||damin|localhost|SHOW VIEW|G +demo1|schema||demo1|localhost|SHOW VIEW|G +demo1|schema||1111|localhost|TRIGGER|G +demo1|schema||damin|localhost|TRIGGER|G +demo1|schema||demo1|localhost|TRIGGER|G +demo1|schema||1111|localhost|UPDATE|G +demo1|schema||damin|localhost|UPDATE|G +demo1|schema||demo1|localhost|UPDATE|G +gitea_5jkh76|schema||gitea_BrjBwG||ALTER|G +gitea_5jkh76|schema||gitea_BrjBwG||ALTER ROUTINE|G +gitea_5jkh76|schema||gitea_BrjBwG||CREATE|G +gitea_5jkh76|schema||gitea_BrjBwG||CREATE ROUTINE|G +gitea_5jkh76|schema||gitea_BrjBwG||CREATE TEMPORARY TABLES|G +gitea_5jkh76|schema||gitea_BrjBwG||CREATE VIEW|G +gitea_5jkh76|schema||gitea_BrjBwG||DELETE|G +gitea_5jkh76|schema||gitea_BrjBwG||DROP|G +gitea_5jkh76|schema||gitea_BrjBwG||EVENT|G +gitea_5jkh76|schema||gitea_BrjBwG||EXECUTE|G +gitea_5jkh76|schema||gitea_BrjBwG||INDEX|G +gitea_5jkh76|schema||gitea_BrjBwG||INSERT|G +gitea_5jkh76|schema||gitea_BrjBwG||LOCK TABLES|G +gitea_5jkh76|schema||gitea_BrjBwG||REFERENCES|G +gitea_5jkh76|schema||gitea_BrjBwG||SELECT|G +gitea_5jkh76|schema||gitea_BrjBwG||SHOW VIEW|G +gitea_5jkh76|schema||gitea_BrjBwG||TRIGGER|G +gitea_5jkh76|schema||gitea_BrjBwG||UPDATE|G +gitea_5jkh76|schema||gitea_BrjBwG||grant option|G +opencdn\\_logs|schema||opencdn||ALTER|G +opencdn\\_logs|schema||opencdn||ALTER ROUTINE|G +opencdn\\_logs|schema||opencdn||CREATE|G +opencdn\\_logs|schema||opencdn||CREATE ROUTINE|G +opencdn\\_logs|schema||opencdn||CREATE TEMPORARY TABLES|G +opencdn\\_logs|schema||opencdn||CREATE VIEW|G +opencdn\\_logs|schema||opencdn||DELETE|G +opencdn\\_logs|schema||opencdn||DROP|G +opencdn\\_logs|schema||opencdn||EVENT|G +opencdn\\_logs|schema||opencdn||EXECUTE|G +opencdn\\_logs|schema||opencdn||INDEX|G +opencdn\\_logs|schema||opencdn||INSERT|G +opencdn\\_logs|schema||opencdn||LOCK TABLES|G +opencdn\\_logs|schema||opencdn||REFERENCES|G +opencdn\\_logs|schema||opencdn||SELECT|G +opencdn\\_logs|schema||opencdn||SHOW VIEW|G +opencdn\\_logs|schema||opencdn||TRIGGER|G +opencdn\\_logs|schema||opencdn||UPDATE|G +opencdn\\_logs|schema||opencdn||grant option|G +opencdn\\_logs\\_2|schema||opencdn||ALTER|G +opencdn\\_logs\\_2|schema||opencdn||ALTER ROUTINE|G +opencdn\\_logs\\_2|schema||opencdn||CREATE|G +opencdn\\_logs\\_2|schema||opencdn||CREATE ROUTINE|G +opencdn\\_logs\\_2|schema||opencdn||CREATE TEMPORARY TABLES|G +opencdn\\_logs\\_2|schema||opencdn||CREATE VIEW|G +opencdn\\_logs\\_2|schema||opencdn||DELETE|G +opencdn\\_logs\\_2|schema||opencdn||DROP|G +opencdn\\_logs\\_2|schema||opencdn||EVENT|G +opencdn\\_logs\\_2|schema||opencdn||EXECUTE|G +opencdn\\_logs\\_2|schema||opencdn||INDEX|G +opencdn\\_logs\\_2|schema||opencdn||INSERT|G +opencdn\\_logs\\_2|schema||opencdn||LOCK TABLES|G +opencdn\\_logs\\_2|schema||opencdn||REFERENCES|G +opencdn\\_logs\\_2|schema||opencdn||SELECT|G +opencdn\\_logs\\_2|schema||opencdn||SHOW VIEW|G +opencdn\\_logs\\_2|schema||opencdn||TRIGGER|G +opencdn\\_logs\\_2|schema||opencdn||UPDATE|G +opencdn\\_logs\\_2|schema||opencdn||grant option|G +opencdn\\_service|schema||opencdn||ALTER|G +opencdn\\_service|schema||opencdn||ALTER ROUTINE|G +opencdn\\_service|schema||opencdn||CREATE|G +opencdn\\_service|schema||opencdn||CREATE ROUTINE|G +opencdn\\_service|schema||opencdn||CREATE TEMPORARY TABLES|G +opencdn\\_service|schema||opencdn||CREATE VIEW|G +opencdn\\_service|schema||opencdn||DELETE|G +opencdn\\_service|schema||opencdn||DROP|G +opencdn\\_service|schema||opencdn||EVENT|G +opencdn\\_service|schema||opencdn||EXECUTE|G +opencdn\\_service|schema||opencdn||INDEX|G +opencdn\\_service|schema||opencdn||INSERT|G +opencdn\\_service|schema||opencdn||LOCK TABLES|G +opencdn\\_service|schema||opencdn||REFERENCES|G +opencdn\\_service|schema||opencdn||SELECT|G +opencdn\\_service|schema||opencdn||SHOW VIEW|G +opencdn\\_service|schema||opencdn||TRIGGER|G +opencdn\\_service|schema||opencdn||UPDATE|G +opencdn\\_service|schema||opencdn||grant option|G +performance_schema|schema||mysql.session|localhost|SELECT|G +sys|schema||mysql.sys|localhost|TRIGGER|G + 8.0.12 + + + armscii8 + + + armscii8 + 1 + + + ascii + + + ascii + 1 + + + big5 + + + big5 + 1 + + + binary + 1 + + + cp1250 + + + cp1250 + + + cp1250 + + + cp1250 + 1 + + + cp1250 + + + cp1251 + + + cp1251 + + + cp1251 + 1 + + + cp1251 + + + cp1251 + + + cp1256 + + + cp1256 + 1 + + + cp1257 + + + cp1257 + 1 + + + cp1257 + + + cp850 + + + cp850 + 1 + + + cp852 + + + cp852 + 1 + + + cp866 + + + cp866 + 1 + + + cp932 + + + cp932 + 1 + + + dec8 + + + dec8 + 1 + + + eucjpms + + + eucjpms + 1 + + + euckr + + + euckr + 1 + + + gb18030 + + + gb18030 + 1 + + + gb18030 + + + gb2312 + + + gb2312 + 1 + + + gbk + + + gbk + 1 + + + geostd8 + + + geostd8 + 1 + + + greek + + + greek + 1 + + + hebrew + + + hebrew + 1 + + + hp8 + + + hp8 + 1 + + + keybcs2 + + + keybcs2 + 1 + + + koi8r + + + koi8r + 1 + + + koi8u + + + koi8u + 1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + + + latin1 + 1 + + + latin2 + + + latin2 + + + latin2 + + + latin2 + 1 + + + latin2 + + + latin5 + + + latin5 + 1 + + + latin7 + + + latin7 + + + latin7 + 1 + + + latin7 + + + macce + + + macce + 1 + + + macroman + + + macroman + 1 + + + sjis + + + sjis + 1 + + + swe7 + + + swe7 + 1 + + + tis620 + + + tis620 + 1 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + 1 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ucs2 + + + ujis + + + ujis + 1 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + 1 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16 + + + utf16le + + + utf16le + 1 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + 1 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf32 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + 1 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8 + + + utf8mb4 + 1 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + utf8mb4 + + + 2025-12-31.14:47:09 + utf8mb4_unicode_520_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8mb4_unicode_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_0900_as_cs + + + utf8mb4_unicode_ci + + + utf8_unicode_ci + + + utf8mb4_unicode_ci + + + utf8_unicode_ci + + + utf8_general_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8_general_ci + + + utf8mb4_unicode_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8mb4_unicode_520_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8_unicode_ci + + + utf8mb4_unicode_ci + + + utf8_unicode_ci + + + utf8mb4_0900_ai_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + utf8_unicode_ci + + + utf8mb4_unicode_ci + + + utf8mb4_unicode_ci + + + + + + 0 + localhost + caching_sha2_password + + + 0 + localhost + caching_sha2_password + + + 0 + localhost + caching_sha2_password + + + + 10.168.% + + + InnoDB + utf8mb4_unicode_520_ci +
+ + 1 + int(8)|0s + 1 + 1 + + + char(12)|0s + 2 + + + char(24)|0s + 3 + + + char(64)|0s + 4 + + + id + btree + 1 + + + 1 + 1 + PRIMARY + +
+
\ No newline at end of file diff --git a/.idea/dataSources/b2cbac2a-802b-4f34-bcd7-5cd59870c776/storage_v2/_src_/schema/api_server_db.FXOnag.meta b/.idea/dataSources/b2cbac2a-802b-4f34-bcd7-5cd59870c776/storage_v2/_src_/schema/api_server_db.FXOnag.meta new file mode 100644 index 0000000..b5be11e --- /dev/null +++ b/.idea/dataSources/b2cbac2a-802b-4f34-bcd7-5cd59870c776/storage_v2/_src_/schema/api_server_db.FXOnag.meta @@ -0,0 +1,2 @@ +#n:api_server_db +! [0, 0, null, null, -2147483648, -2147483648] diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..63e9001 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/httpRequests/http-client.cookies b/.idea/httpRequests/http-client.cookies new file mode 100644 index 0000000..e69de29 diff --git a/.idea/httpRequests/http-requests-log.http b/.idea/httpRequests/http-requests-log.http new file mode 100644 index 0000000..e69de29 diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..3b8e8ce --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..bada8b5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml new file mode 100644 index 0000000..56782ca --- /dev/null +++ b/.idea/sqldialects.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..cc6dd88 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1767189220570 + + + + + + + false + true + + \ No newline at end of file diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..8dea6c2 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,3 @@ +wrapperVersion=3.3.4 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip diff --git a/HELP.md b/HELP.md new file mode 100644 index 0000000..9af9aa9 --- /dev/null +++ b/HELP.md @@ -0,0 +1,18 @@ +# Getting Started + +### Reference Documentation + +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/4.0.1/maven-plugin) +* [Create an OCI image](https://docs.spring.io/spring-boot/4.0.1/maven-plugin/build-image.html) + +### Maven Parent overrides + +Due to Maven's design, elements are inherited from the parent POM to the project POM. +While most of the inheritance is fine, it also inherits unwanted elements like `` and `` from the +parent. +To prevent this, the project POM contains empty overrides for these elements. +If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides. + diff --git a/config/db.yaml b/config/db.yaml new file mode 100644 index 0000000..43c95de --- /dev/null +++ b/config/db.yaml @@ -0,0 +1 @@ +mysql: {database: api_server_db, password: root, port: 3306, host: 10.168.2.2, username: root} diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..aea286e --- /dev/null +++ b/mvnw @@ -0,0 +1,295 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.4 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - GetUsers and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +scriptDir="$(dirname "$0")" +scriptName="$(basename "$0")" + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +actualDistributionDir="" + +# First try the expected directory name (for regular distributions) +if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then + if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then + actualDistributionDir="$distributionUrlNameMain" + fi +fi + +# If not found, search for any directory with the Maven executable (for snapshots) +if [ -z "$actualDistributionDir" ]; then + # enable globbing to iterate over items + set +f + for dir in "$TMP_DOWNLOAD_DIR"/*; do + if [ -d "$dir" ]; then + if [ -f "$dir/bin/$MVN_CMD" ]; then + actualDistributionDir="$(basename "$dir")" + break + fi + fi + done + set -f +fi + +if [ -z "$actualDistributionDir" ]; then + verbose "Contents of $TMP_DOWNLOAD_DIR:" + verbose "$(ls -la "$TMP_DOWNLOAD_DIR")" + die "Could not find Maven distribution directory in extracted archive" +fi + +verbose "Found extracted Maven distribution directory: $actualDistributionDir" +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..92450f9 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,189 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.4 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' + +$MAVEN_M2_PATH = "$HOME/.m2" +if ($env:MAVEN_USER_HOME) { + $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME" +} + +if (-not (Test-Path -Path $MAVEN_M2_PATH)) { + New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null +} + +$MAVEN_WRAPPER_DISTS = $null +if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) { + $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists" +} else { + $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists" +} + +$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain" +$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null + +# Find the actual extracted directory name (handles snapshots where filename != directory name) +$actualDistributionDir = "" + +# First try the expected directory name (for regular distributions) +$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain" +$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD" +if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) { + $actualDistributionDir = $distributionUrlNameMain +} + +# If not found, search for any directory with the Maven executable (for snapshots) +if (!$actualDistributionDir) { + Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object { + $testPath = Join-Path $_.FullName "bin/$MVN_CMD" + if (Test-Path -Path $testPath -PathType Leaf) { + $actualDistributionDir = $_.Name + } + } +} + +if (!$actualDistributionDir) { + Write-Error "Could not find Maven distribution directory in extracted archive" +} + +Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir" +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..22c3598 --- /dev/null +++ b/pom.xml @@ -0,0 +1,78 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 4.0.1 + + + top.gtb520.java.backend + api-back-server + 0.0.1-SNAPSHOT + api-back-server + api-back-server + + + + + + + + + + + + + + + 21 + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-web + + + + + mysql + mysql-connector-java + 8.0.33 + + + + + org.yaml + snakeyaml + 2.0 + + + org.jetbrains + annotations + 26.0.2-1 + compile + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/src/main/java/top/gtb520/java/backend/apibackserver/Main.java b/src/main/java/top/gtb520/java/backend/apibackserver/Main.java new file mode 100644 index 0000000..b046299 --- /dev/null +++ b/src/main/java/top/gtb520/java/backend/apibackserver/Main.java @@ -0,0 +1,42 @@ +package top.gtb520.java.backend.apibackserver; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import top.gtb520.java.backend.apibackserver.utils.YamlFile_Utils; +import top.gtb520.java.backend.apibackserver.utils.tools; + +import java.io.File; +import java.util.List; + +@SpringBootApplication +public class Main { + public static YamlFile_Utils Yaml; + + public static void init() { + Yaml = new YamlFile_Utils(); + // 测试数据库连接 + System.out.println("正在测试数据库连接..."); + tools.testDatabaseConnection(); + } + + public static void main(String[] args) { + try { + init(); + } catch (Exception e) { + System.out.println("初始化失败"); + throw new RuntimeException(e); + } + System.out.println("初始化完成"); + + // 启动程序 + SpringApplication.run(Main.class, args); + } + + private static void Makedirs(List Folders) { + for (File EachFolder : Folders) { + if (!EachFolder.exists()) { + EachFolder.mkdirs(); + } + } + } +} diff --git a/src/main/java/top/gtb520/java/backend/apibackserver/api/u/user.java b/src/main/java/top/gtb520/java/backend/apibackserver/api/u/user.java new file mode 100644 index 0000000..42baa55 --- /dev/null +++ b/src/main/java/top/gtb520/java/backend/apibackserver/api/u/user.java @@ -0,0 +1,68 @@ +package top.gtb520.java.backend.apibackserver.api.u; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; +import top.gtb520.java.backend.apibackserver.db.mysql; + +import static top.gtb520.java.backend.apibackserver.utils.tools.BLUE; +import static top.gtb520.java.backend.apibackserver.utils.tools.echo; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +public class user { + @GetMapping("/user") + public List> GetUsers() throws SQLException { + echo(BLUE, "url: /user"); + + mysql db = new mysql(); + List> users = new ArrayList<>(); + try { + ResultSet rs = db.query("SELECT * FROM user"); + while (rs.next()) { + Map user = new HashMap<>(); + // 假设用户表有id, name, email等字段,根据实际表结构修改 + user.put("id", rs.getInt("id")); + user.put("user_name", rs.getString("user_name")); + user.put("email", rs.getString("email")); + user.put("user_uuid", rs.getString("user_uuid")); + users.add(user); + } + } finally { + db.close(); + } + + System.out.println(users); + return users; + } + + @GetMapping("/user/id/{id}") + public List> GetUserById(@PathVariable int id) throws SQLException { + echo(BLUE, "url: /user/id"); + mysql db = new mysql(); + List> usersID = new ArrayList<>(); + try { + ResultSet rs = db.query("SELECT * FROM user WHERE id = " + id); + while (rs.next()) { + Map userID = new HashMap<>(); + // 假设用户表有id, name, email等字段,根据实际表结构修改 + userID.put("id", rs.getInt("id")); + userID.put("user_name", rs.getString("user_name")); + userID.put("email", rs.getString("email")); + userID.put("user_uuid", rs.getString("user_uuid")); + usersID.add(userID); + } + } finally { + db.close(); + } + System.out.println(usersID); + return usersID; + } + +} diff --git a/src/main/java/top/gtb520/java/backend/apibackserver/db/mysql.java b/src/main/java/top/gtb520/java/backend/apibackserver/db/mysql.java new file mode 100644 index 0000000..0486609 --- /dev/null +++ b/src/main/java/top/gtb520/java/backend/apibackserver/db/mysql.java @@ -0,0 +1,216 @@ +package top.gtb520.java.backend.apibackserver.db; + +import org.yaml.snakeyaml.Yaml; + +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.sql.*; +import java.util.HashMap; +import java.util.Map; + +public class mysql { + private String host; + private int port; + private String database; + private String username; + private String password; + private Connection connection; + + public mysql() { + loadOrCreateConfig(); + connect(); + } + + /** + * 加载或创建数据库配置文件 + */ + private void loadOrCreateConfig() { + String jarPath = getJarDirectory(); + String configPath = jarPath + "/config/db.yaml"; + + Path configFilePath = Paths.get(configPath); + + // 如果配置文件不存在,则创建默认配置 + if (!Files.exists(configFilePath)) { + createDefaultConfig(configFilePath); + } + + // 读取配置文件 + try (FileInputStream fis = new FileInputStream(configPath)) { + Yaml yaml = new Yaml(); + Map data = yaml.load(fis); + + @SuppressWarnings("unchecked") + Map mysqlConfig = (Map) data.get("mysql"); + + this.host = (String) mysqlConfig.get("host"); + this.port = ((Number) mysqlConfig.get("port")).intValue(); + this.database = (String) mysqlConfig.get("database"); + this.username = (String) mysqlConfig.get("username"); + this.password = (String) mysqlConfig.get("password"); + + } catch (IOException e) { + throw new RuntimeException("无法读取数据库配置文件", e); + } + } + + /** + * 创建默认配置文件 + */ + private void createDefaultConfig(Path configFilePath) { + try { + // 确保目录存在 + Files.createDirectories(configFilePath.getParent()); + + // 创建默认配置 + DbConfig defaultConfig = new DbConfig(); + + // 创建YAML内容 + Map config = new HashMap<>(); + Map mysqlSection = new HashMap<>(); + mysqlSection.put("host", defaultConfig.host); + mysqlSection.put("port", defaultConfig.port); + mysqlSection.put("database", defaultConfig.database); + mysqlSection.put("username", defaultConfig.username); + mysqlSection.put("password", defaultConfig.password); + config.put("mysql", mysqlSection); + + // 写入YAML文件 + Yaml yaml = new Yaml(); + String yamlContent = yaml.dump(config); + + Files.write(configFilePath, yamlContent.getBytes()); + + System.out.println("已创建默认数据库配置文件: " + configFilePath); + } catch (IOException e) { + throw new RuntimeException("无法创建数据库配置文件", e); + } + } + + /** + * 获取JAR包所在目录 + */ + private String getJarDirectory() { + try { + String path = getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath(); + if (path.startsWith("/")) { + path = path.substring(1); + } + Path jarPath = Paths.get(path).getParent(); + return jarPath.toString(); + } catch (Exception e) { + // 如果无法获取JAR路径,返回当前工作目录 + return System.getProperty("user.dir"); + } + } + + /** + * 连接到数据库 + */ + public void connect() { + try { + String url = String.format("jdbc:mysql://%s:%d/%s?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true", + host, port, database); + connection = DriverManager.getConnection(url, username, password); + + System.out.println("Connecting to database: " + url + " with username: " + username + " and password: " + password); + + System.out.println("数据库连接成功!"); + } catch (SQLException e) { + throw new RuntimeException("数据库连接失败", e); + } + } + + /** + * 关闭数据库连接 + */ + public void close() { + try { + if (connection != null && !connection.isClosed()) { + connection.close(); + System.out.println("数据库连接已关闭"); + } + } catch (SQLException e) { + e.printStackTrace(); + } + } + + /** + * 执行查询语句 + */ + public ResultSet query(String sql) throws SQLException { + if (connection == null || connection.isClosed()) { + connect(); // 尝试重新连接 + } + Statement statement = connection.createStatement(); + return statement.executeQuery(sql); + } + + /** + * 执行查询语句并返回PreparedStatement + */ + public PreparedStatement prepareQuery(String sql) throws SQLException { + if (connection == null || connection.isClosed()) { + connect(); // 尝试重新连接 + } + return connection.prepareStatement(sql); + } + + /** + * 执行更新语句(INSERT, UPDATE, DELETE) + */ + public int update(String sql) throws SQLException { + if (connection == null || connection.isClosed()) { + connect(); // 尝试重新连接 + } + Statement statement = connection.createStatement(); + return statement.executeUpdate(sql); + } + + /** + * 执行更新语句(带参数的PreparedStatement) + */ + public int update(PreparedStatement pstmt) throws SQLException { + if (connection == null || connection.isClosed()) { + connect(); // 尝试重新连接 + } + return pstmt.executeUpdate(); + } + + /** + * 执行任意SQL语句 + */ + public boolean execute(String sql) throws SQLException { + if (connection == null || connection.isClosed()) { + connect(); // 尝试重新连接 + } + Statement statement = connection.createStatement(); + return statement.execute(sql); + } + + /** + * 检查数据库连接是否有效 + */ + public boolean isConnected() { + try { + return connection != null && !connection.isClosed() && connection.isValid(5); + } catch (SQLException e) { + return false; + } + } + + public Connection getConnection() { + return connection; + } + + public static class DbConfig { + public String host = "localhost"; + public int port = 3306; + public String database = "test"; + public String username = "root"; + public String password = "root"; + } +} diff --git a/src/main/java/top/gtb520/java/backend/apibackserver/utils/YamlFile_Utils.java b/src/main/java/top/gtb520/java/backend/apibackserver/utils/YamlFile_Utils.java new file mode 100644 index 0000000..ec3d207 --- /dev/null +++ b/src/main/java/top/gtb520/java/backend/apibackserver/utils/YamlFile_Utils.java @@ -0,0 +1,62 @@ +package top.gtb520.java.backend.apibackserver.utils; + +import org.jetbrains.annotations.NotNull; + +import java.io.*; +import java.net.URL; +import java.net.URLConnection; + +public class YamlFile_Utils { + + private InputStream getResource(@NotNull String filename) { + try { + URL URL = getClass().getClassLoader().getResource(filename); + if (URL == null) + return null; + URLConnection Connection = URL.openConnection(); + Connection.setUseCaches(false); + return Connection.getInputStream(); + } catch (IOException ex) { + return null; + } + } + + public void saveYmlFile(String FilePath, String FileName, String ResourcePath) { + File Folder = new File(FilePath); + if (!Folder.exists()) + Folder.mkdirs(); + saveResource(FilePath, ResourcePath, FileName, false); + } + + public void saveYamlFile(String FilePath, String FileName, String ResourcePath,boolean Replace) { + File Folder = new File(FilePath); + if (!Folder.exists()) + Folder.mkdirs(); + saveResource(FilePath, ResourcePath, FileName, Replace); + } + + public void saveResource(String FilePath, @NotNull String ResourcePath, String OutFileName, boolean Replace) { + if (ResourcePath.equals("")) + throw new IllegalArgumentException("ResourcePath cannot be null or empty"); + ResourcePath = ResourcePath.replace('\\', '/'); + InputStream in = getResource(ResourcePath); + if (in == null) + throw new IllegalArgumentException("The embedded resource '" + ResourcePath + "' cannot be found in " + ResourcePath); + File OutFile = new File(FilePath, OutFileName); + try { + if (!OutFile.exists() || Replace) { + OutputStream out = new FileOutputStream(OutFile); + byte[] buf = new byte[1024]; + int Len; + while ((Len = in.read(buf)) > 0) + out.write(buf, 0, Len); + out.close(); + in.close(); + } else { + System.out.println("Could not save " + OutFile.getName() + " to " + OutFile + " because " + OutFile.getName() + " already exists."); + } + } catch (IOException ex) { + System.out.println("Could not save " + OutFile.getName() + " to " + OutFile); + } + } +} diff --git a/src/main/java/top/gtb520/java/backend/apibackserver/utils/tools.java b/src/main/java/top/gtb520/java/backend/apibackserver/utils/tools.java new file mode 100644 index 0000000..fe52b4f --- /dev/null +++ b/src/main/java/top/gtb520/java/backend/apibackserver/utils/tools.java @@ -0,0 +1,79 @@ +package top.gtb520.java.backend.apibackserver.utils; + +import org.springframework.stereotype.Component; +import top.gtb520.java.backend.apibackserver.db.mysql; + +import java.sql.ResultSet; +import java.sql.SQLException; + +@Component +public class tools { + + // ANSI颜色代码 + public static final String RESET = "\u001B[0m"; + public static final String BLACK = "\u001B[30m"; + public static final String RED = "\u001B[31m"; + public static final String GREEN = "\u001B[32m"; + public static final String YELLOW = "\u001B[33m"; + public static final String BLUE = "\u001B[34m"; + public static final String PURPLE = "\u001B[35m"; + public static final String CYAN = "\u001B[36m"; + public static final String WHITE = "\u001B[37m"; + + // 背景色 + public static final String BLACK_BACKGROUND = "\u001B[40m"; + public static final String RED_BACKGROUND = "\u001B[41m"; + public static final String GREEN_BACKGROUND = "\u001B[42m"; + public static final String YELLOW_BACKGROUND = "\u001B[43m"; + public static final String BLUE_BACKGROUND = "\u001B[44m"; + public static final String PURPLE_BACKGROUND = "\u001B[45m"; + public static final String CYAN_BACKGROUND = "\u001B[46m"; + public static final String WHITE_BACKGROUND = "\u001B[47m"; + + /** + * 打印带颜色的文本到终端 + * @param color 颜色代码 + * @param text 要打印的文本 + */ + public static void printColor(String color, String text) { + System.out.println(color + text + RESET); + } + + /** + * 返回带颜色的文本字符串 + * @param color 颜色代码 + * @param text 要着色的文本 + * @return 带颜色的文本字符串 + */ + public static String getColorText(String color, String text) { + return color + text + RESET; + } + public static void echo(String color, String message){ + System.out.println(color + message + RESET); + System.out.flush(); + } + + /** + * 测试数据库连接的简单方法 + */ + public static void testDatabaseConnection() { + mysql db = new mysql(); + try { + if (db.isConnected()) { + System.out.println("数据库连接测试成功!"); + + // 测试查询 + ResultSet rs = db.query("SELECT 1 as test"); + if (rs.next()) { + System.out.println("查询结果: " + rs.getInt("test")); + } + } else { + System.out.println("数据库连接测试失败!"); + } + } catch (SQLException e) { + System.out.println("执行查询时出错: " + e.getMessage()); + } finally { + db.close(); + } + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties new file mode 100644 index 0000000..3eb6a3b --- /dev/null +++ b/src/main/resources/application.properties @@ -0,0 +1,3 @@ +spring.application.name=api-back-server +server.port=3156 +server.address=0.0.0.0 diff --git a/src/test/java/top/gtb520/java/backend/apibackserver/MainTests.java b/src/test/java/top/gtb520/java/backend/apibackserver/MainTests.java new file mode 100644 index 0000000..2de7478 --- /dev/null +++ b/src/test/java/top/gtb520/java/backend/apibackserver/MainTests.java @@ -0,0 +1,13 @@ +package top.gtb520.java.backend.apibackserver; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class MainTests { + + @Test + void contextLoads() { + } + +} diff --git a/target/api-back-server-0.0.1-SNAPSHOT.jar b/target/api-back-server-0.0.1-SNAPSHOT.jar new file mode 100644 index 0000000..1cf1a9d Binary files /dev/null and b/target/api-back-server-0.0.1-SNAPSHOT.jar differ diff --git a/target/api-back-server-0.0.1-SNAPSHOT.jar.original b/target/api-back-server-0.0.1-SNAPSHOT.jar.original new file mode 100644 index 0000000..aff0cdf Binary files /dev/null and b/target/api-back-server-0.0.1-SNAPSHOT.jar.original differ diff --git a/target/classes/app.yaml b/target/classes/app.yaml new file mode 100644 index 0000000..af13098 --- /dev/null +++ b/target/classes/app.yaml @@ -0,0 +1,3 @@ +app: + port: 76332 + address: "0.0.0.0" diff --git a/target/classes/application.properties b/target/classes/application.properties new file mode 100644 index 0000000..3eb6a3b --- /dev/null +++ b/target/classes/application.properties @@ -0,0 +1,3 @@ +spring.application.name=api-back-server +server.port=3156 +server.address=0.0.0.0 diff --git a/target/classes/top/gtb520/java/backend/apibackserver/Main.class b/target/classes/top/gtb520/java/backend/apibackserver/Main.class new file mode 100644 index 0000000..e544cd8 Binary files /dev/null and b/target/classes/top/gtb520/java/backend/apibackserver/Main.class differ diff --git a/target/classes/top/gtb520/java/backend/apibackserver/api/u/user.class b/target/classes/top/gtb520/java/backend/apibackserver/api/u/user.class new file mode 100644 index 0000000..a08e6fc Binary files /dev/null and b/target/classes/top/gtb520/java/backend/apibackserver/api/u/user.class differ diff --git a/target/classes/top/gtb520/java/backend/apibackserver/db/mysql$DbConfig.class b/target/classes/top/gtb520/java/backend/apibackserver/db/mysql$DbConfig.class new file mode 100644 index 0000000..c88472c Binary files /dev/null and b/target/classes/top/gtb520/java/backend/apibackserver/db/mysql$DbConfig.class differ diff --git a/target/classes/top/gtb520/java/backend/apibackserver/db/mysql.class b/target/classes/top/gtb520/java/backend/apibackserver/db/mysql.class new file mode 100644 index 0000000..ec97c40 Binary files /dev/null and b/target/classes/top/gtb520/java/backend/apibackserver/db/mysql.class differ diff --git a/target/classes/top/gtb520/java/backend/apibackserver/utils/YamlFile_Utils.class b/target/classes/top/gtb520/java/backend/apibackserver/utils/YamlFile_Utils.class new file mode 100644 index 0000000..6e8b80e Binary files /dev/null and b/target/classes/top/gtb520/java/backend/apibackserver/utils/YamlFile_Utils.class differ diff --git a/target/classes/top/gtb520/java/backend/apibackserver/utils/tools.class b/target/classes/top/gtb520/java/backend/apibackserver/utils/tools.class new file mode 100644 index 0000000..c1535ef Binary files /dev/null and b/target/classes/top/gtb520/java/backend/apibackserver/utils/tools.class differ diff --git a/target/config/db.yaml b/target/config/db.yaml new file mode 100644 index 0000000..239f8b4 --- /dev/null +++ b/target/config/db.yaml @@ -0,0 +1 @@ +mysql: {database: test, password: root, port: 3306, host: localhost, username: root} diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..4d66276 --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=api-back-server +groupId=top.gtb520.java.backend +version=0.0.1-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..f12c86f --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,6 @@ +top\gtb520\java\backend\apibackserver\db\mysql$DbConfig.class +top\gtb520\java\backend\apibackserver\db\mysql.class +top\gtb520\java\backend\apibackserver\utils\YamlFile_Utils.class +top\gtb520\java\backend\apibackserver\utils\tools.class +top\gtb520\java\backend\apibackserver\api\u\user.class +top\gtb520\java\backend\apibackserver\Main.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..65f4dd1 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,5 @@ +G:\Project\Java\api-back-server\src\main\java\top\gtb520\java\backend\apibackserver\api\u\user.java +G:\Project\Java\api-back-server\src\main\java\top\gtb520\java\backend\apibackserver\db\mysql.java +G:\Project\Java\api-back-server\src\main\java\top\gtb520\java\backend\apibackserver\Main.java +G:\Project\Java\api-back-server\src\main\java\top\gtb520\java\backend\apibackserver\utils\tools.java +G:\Project\Java\api-back-server\src\main\java\top\gtb520\java\backend\apibackserver\utils\YamlFile_Utils.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..b7d682b --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1 @@ +top\gtb520\java\backend\apibackserver\MainTests.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..0e5ed06 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +G:\Project\Java\api-back-server\src\test\java\top\gtb520\java\backend\apibackserver\MainTests.java diff --git a/target/test-classes/top/gtb520/java/backend/apibackserver/MainTests.class b/target/test-classes/top/gtb520/java/backend/apibackserver/MainTests.class new file mode 100644 index 0000000..604f699 Binary files /dev/null and b/target/test-classes/top/gtb520/java/backend/apibackserver/MainTests.class differ