Compare commits

...

7 Commits

Author SHA1 Message Date
QAIU
9ded137539 jdk11兼容 2024-06-19 09:51:08 +08:00
qaiu
966417f867 Merge pull request #45 from qaiu/dependabot/npm_and_yarn/web-front/multi-d7cccafd4e
Bump braces and filemanager-webpack-plugin in /web-front
2024-06-14 12:14:05 +08:00
dependabot[bot]
601a0d1b91 Bump braces and filemanager-webpack-plugin in /web-front
Bumps [braces](https://github.com/micromatch/braces) to 3.0.3 and updates ancestor dependency [filemanager-webpack-plugin](https://github.com/gregnb/filemanager-webpack-plugin). These dependencies need to be updated together.


Updates `braces` from 3.0.2 to 3.0.3
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

Updates `filemanager-webpack-plugin` from 2.0.5 to 8.0.0
- [Release notes](https://github.com/gregnb/filemanager-webpack-plugin/releases)
- [Changelog](https://github.com/gregnb/filemanager-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gregnb/filemanager-webpack-plugin/compare/v2.0.5...v8.0.0)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
- dependency-name: filemanager-webpack-plugin
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 06:54:54 +00:00
QAIU
ae91ce773e maven-dependency-submission-action add ignore-maven-wrapper: true 2024-06-07 11:17:37 +08:00
QAIU
d428380f79 add maven wrapper build script 2024-06-07 09:33:57 +08:00
QAIU
b0b8b61688 支持mysql 2024-06-06 18:10:15 +08:00
QAIU
7663320a55 1. h2数据库文件优化, 取消h2server启动
2. 项目结构优化, pom版本统一管理
3. core的beanutils依赖升级为commons-beanutils2版本, 修复之前版本的安全风险.
4. 此版本打包部署需要替换之前所有依赖
2024-06-06 18:06:33 +08:00
40 changed files with 2296 additions and 2578 deletions

View File

@@ -37,6 +37,8 @@ jobs:
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph - name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@v3 uses: advanced-security/maven-dependency-submission-action@v3
with:
ignore-maven-wrapper: true
# - uses: release-drafter/release-drafter@v5 # - uses: release-drafter/release-drafter@v5
# env: # env:

117
.mvn/wrapper/MavenWrapperDownloader.java vendored Normal file
View File

@@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed 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
*
* https://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.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

BIN
.mvn/wrapper/maven-wrapper.jar vendored Normal file

Binary file not shown.

2
.mvn/wrapper/maven-wrapper.properties vendored Normal file
View File

@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

22
bin/build.bat Normal file
View File

@@ -0,0 +1,22 @@
@echo off
setlocal
rem 获取当前 Java 版本信息并搜索是否包含 "11."
java -version 2>&1 | find "11." >nul
rem 如果找不到 JDK 17.x则下载并安装
if errorlevel 1 (
echo JDK 11.x not found. Downloading and installing...
REM 这里添加下载和安装 JDK 的代码
rem 验证安装
java -version
echo JDK 11.x installation complete.
) else (
echo JDK 11.x is already installed.
)
endlocal
pause

View File

@@ -7,7 +7,7 @@ Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
# User=USER # User=USER
# 需要JDK17及以上版本 注意修改为自己的路径 # 需要JDK11及以上版本 注意修改为自己的路径
ExecStart=/root/java/jdk-17.0.2/bin/java -server -Xmx128m -jar /root/java/netdisk-fast-download/netdisk-fast-download.jar ExecStart=/root/java/jdk-17.0.2/bin/java -server -Xmx128m -jar /root/java/netdisk-fast-download/netdisk-fast-download.jar
ExecStop=/bin/kill -s QUIT $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID
Restart=always Restart=always

View File

@@ -1,4 +1,6 @@
@echo off && @chcp 65001 > nul @echo off && @chcp 65001 > nul
:: 需要JDK11及以上版本和Windows环境变量已配置jdk的路径
pushd %~dp0 pushd %~dp0
set LIB_DIR=%~dp0 set LIB_DIR=%~dp0
for /f "delims=X" %%i in ('dir /b %LIB_DIR%\netdisk-fast-download.jar') do ( for /f "delims=X" %%i in ('dir /b %LIB_DIR%\netdisk-fast-download.jar') do (

View File

@@ -5,14 +5,14 @@
<parent> <parent>
<artifactId>netdisk-fast-download</artifactId> <artifactId>netdisk-fast-download</artifactId>
<groupId>cn.qaiu</groupId> <groupId>cn.qaiu</groupId>
<version>0.1.7</version> <version>${revision}</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>core-database</artifactId> <artifactId>core-database</artifactId>
<properties> <properties>
<java.version>17</java.version> <java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>2.0.5</slf4j.version> <slf4j.version>2.0.5</slf4j.version>
<commons-lang3.version>3.12.0</commons-lang3.version> <commons-lang3.version>3.12.0</commons-lang3.version>
@@ -23,7 +23,6 @@
<dependency> <dependency>
<groupId>cn.qaiu</groupId> <groupId>cn.qaiu</groupId>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<version>1.0.8</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 --> <!-- https://mvnrepository.com/artifact/com.h2database/h2 -->

View File

@@ -1,5 +1,6 @@
package cn.qaiu.db.ddl; package cn.qaiu.db.ddl;
import cn.qaiu.db.pool.JDBCType;
import cn.qaiu.vx.core.util.ReflectionUtil; import cn.qaiu.vx.core.util.ReflectionUtil;
import io.vertx.codegen.format.CamelCase; import io.vertx.codegen.format.CamelCase;
import io.vertx.codegen.format.Case; import io.vertx.codegen.format.Case;
@@ -65,7 +66,9 @@ public class CreateTable {
} }
} }
public static String getCreateTableSQL(Class<?> clz) { public static String getCreateTableSQL(Class<?> clz, JDBCType type) {
String quotationMarks = type == JDBCType.H2DB ? "\"" : "`";
String endStr = type == JDBCType.H2DB ? ");" : ")ENGINE=InnoDB DEFAULT CHARSET=utf8;";
// 判断类上是否有次注解 // 判断类上是否有次注解
String primaryKey = null; // 主键 String primaryKey = null; // 主键
String tableName = null; // 表名 String tableName = null; // 表名
@@ -93,7 +96,7 @@ public class CreateTable {
int[] decimalSize = {22, 2}; int[] decimalSize = {22, 2};
int varcharSize = 255; int varcharSize = 255;
StringBuilder sb = new StringBuilder(50); StringBuilder sb = new StringBuilder(50);
sb.append("CREATE TABLE IF NOT EXISTS \"").append(tableName).append("\" ( \r\n "); sb.append("CREATE TABLE IF NOT EXISTS ").append(quotationMarks).append(tableName).append(quotationMarks).append(" ( \r\n ");
boolean firstId = true; boolean firstId = true;
for (Field f : fields) { for (Field f : fields) {
Class<?> paramType = f.getType(); Class<?> paramType = f.getType();
@@ -114,7 +117,7 @@ public class CreateTable {
decimalSize = fieldAnnotation.decimalSize(); decimalSize = fieldAnnotation.decimalSize();
varcharSize = fieldAnnotation.varcharSize(); varcharSize = fieldAnnotation.varcharSize();
} }
sb.append("\"").append(column).append("\""); sb.append(quotationMarks).append(column).append(quotationMarks);
sb.append(" ").append(sqlType); sb.append(" ").append(sqlType);
// 添加类型长度 // 添加类型长度
if (sqlType.equals("DECIMAL")) { if (sqlType.equals("DECIMAL")) {
@@ -155,17 +158,20 @@ public class CreateTable {
//去掉最后一个逗号 //去掉最后一个逗号
int lastIndex = sql.lastIndexOf(","); int lastIndex = sql.lastIndexOf(",");
sql = sql.substring(0, lastIndex) + sql.substring(lastIndex + 1); sql = sql.substring(0, lastIndex) + sql.substring(lastIndex + 1);
return sql.substring(0, sql.length() - 1) + ");\r\n"; return sql.substring(0, sql.length() - 1) + endStr;
} }
public static void createTable(JDBCPool pool) { public static void createTable(JDBCPool pool, JDBCType type) {
Set<Class<?>> tableClassList = ReflectionUtil.getReflections().getTypesAnnotatedWith(Table.class); Set<Class<?>> tableClassList = ReflectionUtil.getReflections().getTypesAnnotatedWith(Table.class);
if (tableClassList.isEmpty()) LOGGER.info("Table model class not fount"); if (tableClassList.isEmpty()) LOGGER.info("Table model class not fount");
tableClassList.forEach(clazz -> { tableClassList.forEach(clazz -> {
String createTableSQL = getCreateTableSQL(clazz); String createTableSQL = getCreateTableSQL(clazz, type);
pool.query(createTableSQL).execute().onSuccess( pool.query(createTableSQL).execute().onSuccess(
rs -> LOGGER.info("\n" + createTableSQL + "create table --> ok") rs -> LOGGER.info("table auto generate:\n" + createTableSQL)
).onFailure(Throwable::printStackTrace); ).onFailure(e -> {
LOGGER.error(e.getMessage() + " SQL: \n" + createTableSQL);
});
}); });
} }
} }

View File

@@ -1,20 +1,13 @@
package cn.qaiu.db.pool; package cn.qaiu.db.pool;
import cn.qaiu.db.ddl.CreateTable; import cn.qaiu.db.ddl.CreateTable;
import cn.qaiu.db.server.H2ServerHolder;
import cn.qaiu.vx.core.util.VertxHolder; import cn.qaiu.vx.core.util.VertxHolder;
import io.vertx.core.Promise;
import io.vertx.core.Vertx; import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject; import io.vertx.core.json.JsonObject;
import io.vertx.jdbcclient.JDBCPool; import io.vertx.jdbcclient.JDBCPool;
import org.h2.tools.Server;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
/** /**
* 初始化JDBC * 初始化JDBC
* <br>Create date 2021/8/10 12:04 * <br>Create date 2021/8/10 12:04
@@ -28,12 +21,14 @@ public class JDBCPoolInit {
JsonObject dbConfig; JsonObject dbConfig;
Vertx vertx = VertxHolder.getVertxInstance(); Vertx vertx = VertxHolder.getVertxInstance();
String url; String url;
private JDBCType type;
private static JDBCPoolInit instance; private static JDBCPoolInit instance;
public JDBCPoolInit(Builder builder) { public JDBCPoolInit(Builder builder) {
this.dbConfig = builder.dbConfig; this.dbConfig = builder.dbConfig;
this.url = builder.url; this.url = builder.url;
this.type = builder.type;
} }
public static Builder builder() { public static Builder builder() {
@@ -47,10 +42,12 @@ public class JDBCPoolInit {
public static class Builder { public static class Builder {
private JsonObject dbConfig; private JsonObject dbConfig;
private String url; private String url;
private JDBCType type;
public Builder config(JsonObject dbConfig) { public Builder config(JsonObject dbConfig) {
this.dbConfig = dbConfig; this.dbConfig = dbConfig;
this.url = dbConfig.getString("jdbcUrl"); this.url = dbConfig.getString("jdbcUrl");
this.type = JDBCUtil.getJDBCType(dbConfig.getString("driverClassName"));
return this; return this;
} }
@@ -73,67 +70,16 @@ public class JDBCPoolInit {
return; return;
} }
// 异步启动H2服务 // 初始化数据库连接
vertx.createSharedWorkerExecutor("h2-server", 1, Long.MAX_VALUE) vertx.createSharedWorkerExecutor("sql-pool-init")
.executeBlocking(this::h2serverExecute) .executeBlocking(() -> {
.onSuccess(res->{ // 初始化连接池
LOGGER.info(res); pool = JDBCPool.pool(vertx, dbConfig);
// 初始化数据库连接 CreateTable.createTable(pool, type);
vertx.createSharedWorkerExecutor("sql-pool-init") return "数据库连接初始化: URL=" + url;
.executeBlocking(this::poolInitExecute)
.onSuccess(LOGGER::info)
.onFailure(Throwable::printStackTrace);
}) })
.onSuccess(LOGGER::info)
.onFailure(Throwable::printStackTrace); .onFailure(Throwable::printStackTrace);
}
private void poolInitExecute(Promise<String> promise) {
// 初始化连接池
pool = JDBCPool.pool(vertx, dbConfig);
CreateTable.createTable(pool);
promise.complete("init jdbc pool success");
}
private void checkOrCreateDBFile() {
LOGGER.info("init sql start");
String[] path = url.split("\\./");
path[1] = path[1].split(";")[0];
path[1] += ".mv.db";
File file = new File(path[1]);
if (!file.exists()) {
if (!file.getParentFile().exists()) {
if (file.getParentFile().mkdirs()) {
LOGGER.info("mkdirs -> {}", file.getParentFile().getAbsolutePath());
}
}
try {
if (file.createNewFile()) {
LOGGER.info("create file -> {}", file.getAbsolutePath());
}
} catch (IOException e) {
LOGGER.error(e.getMessage());
throw new RuntimeException("file create failed");
}
}
}
private void h2serverExecute(Promise<String> promise) {
// 初始化H2db, 创建本地db文件
checkOrCreateDBFile();
try {
String url = dbConfig.getString("jdbcUrl");
String[] portStr = url.split(":");
String port = portStr[portStr.length - 1].split("[/\\\\]")[0];
LOGGER.info("H2server listen port to {}", port);
H2ServerHolder.init(Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", port).start());
promise.complete("Start h2Server success");
} catch (SQLException e) {
throw new RuntimeException("Start h2Server failed: " + e.getMessage());
}
} }
/** /**

View File

@@ -0,0 +1,9 @@
package cn.qaiu.db.pool;
/**
* @author <a href="https://qaiu.top">QAIU</a>
* @date 2023/10/10 14:06
*/
public enum JDBCType {
MySQL, H2DB
}

View File

@@ -0,0 +1,18 @@
package cn.qaiu.db.pool;
/**
* @author <a href="https://qaiu.top">QAIU</a>
* @date 2023/10/10 14:05
*/
public class JDBCUtil {
public static JDBCType getJDBCType(String deviceName) {
switch (deviceName) {
case "com.mysql.cj.jdbc.Driver":
case "com.mysql.jdbc.Driver":
return JDBCType.MySQL;
case "org.h2.Driver":
return JDBCType.H2DB;
}
throw new RuntimeException("不支持的SQL驱动类型: " + deviceName);
}
}

View File

@@ -5,28 +5,15 @@
<parent> <parent>
<artifactId>netdisk-fast-download</artifactId> <artifactId>netdisk-fast-download</artifactId>
<groupId>cn.qaiu</groupId> <groupId>cn.qaiu</groupId>
<version>0.1.7</version> <version>${revision}</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>1.0.8</version>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-dependencies</artifactId>
<version>${vertx.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies> <dependencies>
<!--logback日志实现--> <!--logback日志实现-->
<dependency> <dependency>
@@ -73,11 +60,13 @@
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version> <version>${commons-lang3.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.melloware/commons-beanutils2 -->
<dependency> <dependency>
<groupId>commons-beanutils</groupId> <groupId>com.melloware</groupId>
<artifactId>commons-beanutils</artifactId> <artifactId>commons-beanutils2</artifactId>
<version>1.9.4</version> <version>${commons-beanutils2.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>

View File

@@ -87,19 +87,15 @@ public final class Deploy {
var calendar = Calendar.getInstance(); var calendar = Calendar.getInstance();
calendar.setTime(new Date()); calendar.setTime(new Date());
var year = calendar.get(Calendar.YEAR); var year = calendar.get(Calendar.YEAR);
var logoTemplate = """
Web Server powered by:\s
____ ____ _ _ _ \s
|_^^_| |_^^_| / |_ | | | | \s
\\ \\ / /.---. _ .--.`| |-' _ __ | |__| |_ \s
\\ \\ / // /__\\\\[ `/'`\\]| | [ \\ [ ]|____ _|\s
\\ V / | \\__., | | | |, _ > ' < _| |_ \s
\\_/ '.__.'[___] \\__/(_)[__]`\\_] |_____|\s
Version: %s; Framework version: %s; %s©%d.
""";
String logoTemplate = "Web Server powered by: \n" +
" ____ ____ _ _ _ \n" +
"|_^^_| |_^^_| / |_ | | | | \n" +
" \\ \\ / /.---. _ .--.`| |-' _ __ | |__| |_ \n" +
" \\ \\ / // /__\\\\[ `/'`\\]| | [ \\ [ ]|____ _|\n" +
" \\ V / | \\__., | | | |, _ > ' < _| |_ \n" +
" \\_/ '.__.'[___] \\__/(_)[__]`\\_] |_____|\n" +
" Version: %s; Framework version: %s; JDK11; %s©%d.\n\n";
System.out.printf(logoTemplate, System.out.printf(logoTemplate,
conf.getString("version_app"), conf.getString("version_app"),
VersionCommand.getVersion(), VersionCommand.getVersion(),
@@ -132,9 +128,10 @@ public final class Deploy {
localMap.put(GLOBAL_CONFIG, globalConfig); localMap.put(GLOBAL_CONFIG, globalConfig);
localMap.put(CUSTOM_CONFIG, customConfig); localMap.put(CUSTOM_CONFIG, customConfig);
localMap.put(SERVER, globalConfig.getJsonObject(SERVER)); localMap.put(SERVER, globalConfig.getJsonObject(SERVER));
var future0 = vertx.createSharedWorkerExecutor("other-handle").executeBlocking(bch -> { var future0 = vertx.createSharedWorkerExecutor("other-handle").executeBlocking(() -> {
handle.handle(globalConfig); handle.handle(globalConfig);
bch.complete("other handle complete"); LOGGER.info("other handle complete");
return null;
}); });
// 部署 路由、异步service、反向代理 服务 // 部署 路由、异步service、反向代理 服务
@@ -142,7 +139,7 @@ public final class Deploy {
var future2 = vertx.deployVerticle(ServiceVerticle.class, getWorkDeploymentOptions("Service")); var future2 = vertx.deployVerticle(ServiceVerticle.class, getWorkDeploymentOptions("Service"));
var future3 = vertx.deployVerticle(ReverseProxyVerticle.class, getWorkDeploymentOptions("proxy")); var future3 = vertx.deployVerticle(ReverseProxyVerticle.class, getWorkDeploymentOptions("proxy"));
CompositeFuture.all(future1, future2, future3, future0) Future.all(future1, future2, future3, future0)
.onSuccess(this::deployWorkVerticalSuccess) .onSuccess(this::deployWorkVerticalSuccess)
.onFailure(this::deployVerticalFailed); .onFailure(this::deployVerticalFailed);
} }
@@ -181,7 +178,7 @@ public final class Deploy {
private DeploymentOptions getWorkDeploymentOptions(String name, int ins) { private DeploymentOptions getWorkDeploymentOptions(String name, int ins) {
return new DeploymentOptions() return new DeploymentOptions()
.setWorkerPoolName(name) .setWorkerPoolName(name)
.setWorker(true) .setThreadingModel(ThreadingModel.WORKER)
.setInstances(ins); .setInstances(ins);
} }

View File

@@ -112,7 +112,7 @@ public class RouterHandlerFactory implements BaseHttpApi {
return Integer.compare(routeHandler2.order(), routeHandler1.order()); return Integer.compare(routeHandler2.order(), routeHandler1.order());
}; };
// 获取处理器类列表 // 获取处理器类列表
List<Class<?>> sortedHandlers = handlers.stream().sorted(comparator).toList(); List<Class<?>> sortedHandlers = handlers.stream().sorted(comparator).collect(Collectors.toList());
for (Class<?> handler : sortedHandlers) { for (Class<?> handler : sortedHandlers) {
try { try {
// 注册请求处理方法 // 注册请求处理方法
@@ -153,7 +153,7 @@ public class RouterHandlerFactory implements BaseHttpApi {
methodList.addAll(Stream.of(methods).filter( methodList.addAll(Stream.of(methods).filter(
method -> method.isAnnotationPresent(SockRouteMapper.class) method -> method.isAnnotationPresent(SockRouteMapper.class)
).toList()); ).collect(Collectors.toList()));
// 依次注册处理方法 // 依次注册处理方法
for (Method method : methodList) { for (Method method : methodList) {

View File

@@ -6,7 +6,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import io.vertx.core.json.JsonObject; import io.vertx.core.json.JsonObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
/** /**
@@ -17,7 +16,6 @@ import java.io.Serializable;
*/ */
public class JsonResult<T> implements Serializable { public class JsonResult<T> implements Serializable {
@Serial
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final int SUCCESS_CODE = 200; private static final int SUCCESS_CODE = 200;

View File

@@ -3,8 +3,8 @@ package cn.qaiu.vx.core.util;
import cn.qaiu.vx.core.annotaions.HandleSortFilter; import cn.qaiu.vx.core.annotaions.HandleSortFilter;
import io.vertx.core.buffer.Buffer; import io.vertx.core.buffer.Buffer;
import io.vertx.core.json.JsonObject; import io.vertx.core.json.JsonObject;
import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils2.ConvertUtils;
import org.apache.commons.beanutils.Converter; import org.apache.commons.beanutils2.Converter;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@@ -1,7 +1,7 @@
package cn.qaiu.vx.core.util; package cn.qaiu.vx.core.util;
import io.vertx.core.MultiMap; import io.vertx.core.MultiMap;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils2.BeanUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@@ -5,12 +5,13 @@ import javassist.bytecode.AccessFlag;
import javassist.bytecode.CodeAttribute; import javassist.bytecode.CodeAttribute;
import javassist.bytecode.LocalVariableAttribute; import javassist.bytecode.LocalVariableAttribute;
import javassist.bytecode.MethodInfo; import javassist.bytecode.MethodInfo;
import org.apache.commons.beanutils.ConversionException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import org.reflections.Reflections; import org.reflections.Reflections;
import org.reflections.scanners.*; import org.reflections.scanners.MemberUsageScanner;
import org.reflections.scanners.MethodParameterNamesScanner;
import org.reflections.scanners.Scanners;
import org.reflections.util.ClasspathHelper; import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder; import org.reflections.util.ConfigurationBuilder;
import org.reflections.util.FilterBuilder; import org.reflections.util.FilterBuilder;
@@ -185,10 +186,10 @@ public final class ReflectionUtil {
return DateUtils.parseDate(value, fmt); return DateUtils.parseDate(value, fmt);
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
throw new ConversionException("无法将格式化日期"); throw new RuntimeException("无法将格式化日期");
} }
default: default:
throw new ConversionException("无法将String类型" + value + "转为[" + name + "]"); throw new RuntimeException("无法将String类型" + value + "转为[" + name + "]");
} }
} }
@@ -200,7 +201,7 @@ public final class ReflectionUtil {
* @return Array * @return Array
*/ */
public static Object conversionArray(CtClass ctClass, String value) { public static Object conversionArray(CtClass ctClass, String value) {
if (!isBasicTypeArray(ctClass)) throw new ConversionException("无法解析数组"); if (!isBasicTypeArray(ctClass)) throw new RuntimeException("无法解析数组");
String[] strArr = value.split(","); String[] strArr = value.split(",");
List<Object> obj = new ArrayList<>(); List<Object> obj = new ArrayList<>();
Arrays.stream(strArr).forEach(v -> obj.add(conversion(ctClass, v, null))); Arrays.stream(strArr).forEach(v -> obj.add(conversion(ctClass, v, null)));

310
mvnw vendored Normal file
View File

@@ -0,0 +1,310 @@
#!/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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
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"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

182
mvnw.cmd vendored Normal file
View File

@@ -0,0 +1,182 @@
@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 Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%

View File

@@ -22,3 +22,9 @@ Cloudreve自建网盘 (ce) {origin}/s/{shareKey}
https://f.ws59.cn/f/e3peohu6192 https://f.ws59.cn/f/e3peohu6192
短链接设计

View File

@@ -2,13 +2,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> 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>
<parent> <parent>
<artifactId>netdisk-fast-download</artifactId> <artifactId>netdisk-fast-download</artifactId>
<groupId>cn.qaiu</groupId> <groupId>cn.qaiu</groupId>
<version>0.1.7</version> <version>${revision}</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>parser</artifactId> <artifactId>parser</artifactId>
<properties> <properties>

View File

@@ -7,24 +7,22 @@ public interface IPanTool {
Future<String> parse(); Future<String> parse();
static IPanTool typeMatching(String type, String key, String pwd) { static IPanTool typeMatching(String type, String key, String pwd) {
return switch (type) { switch (type) {
case "lz" -> new LzTool(key, pwd); case "lz": return new LzTool(key, pwd);
case "cow" -> new CowTool(key, pwd); case "cow": return new CowTool(key, pwd);
case "ec" -> new EcTool(key, pwd); case "ec": return new EcTool(key, pwd);
case "fc" -> new FcTool(key, pwd); case "fc": return new FcTool(key, pwd);
case "uc" -> new UcTool(key, pwd); case "uc": return new UcTool(key, pwd);
case "ye" -> new YeTool(key, pwd); case "ye": return new YeTool(key, pwd);
case "fj" -> new FjTool(key, pwd); case "fj": return new FjTool(key, pwd);
case "qk" -> new QkTool(key, pwd); case "qk": return new QkTool(key, pwd);
case "le" -> new LeTool(key, pwd); case "le": return new LeTool(key, pwd);
case "ws" -> new WsTool(key, pwd); case "ws": return new WsTool(key, pwd);
case "qq" -> new QQTool(key, pwd); case "qq": return new QQTool(key, pwd);
case "iz" -> new IzTool(key, pwd); case "iz": return new IzTool(key, pwd);
case "ce" -> new CeTool(key, pwd); case "ce": return new CeTool(key, pwd);
default -> { default: throw new UnsupportedOperationException("未知分享类型");
throw new UnsupportedOperationException("未知分享类型"); }
}
};
} }
static IPanTool shareURLPrefixMatching(String url, String pwd) { static IPanTool shareURLPrefixMatching(String url, String pwd) {

View File

@@ -1,5 +1,6 @@
package cn.qaiu.util; package cn.qaiu.util;
import cn.qaiu.util.jdk17halper.HexFormat;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import javax.crypto.*; import javax.crypto.*;
@@ -12,7 +13,6 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.Base64; import java.util.Base64;
import java.util.Date; import java.util.Date;
import java.util.HexFormat;
import java.util.Random; import java.util.Random;
/** /**

View File

@@ -1,152 +1,160 @@
package cn.qaiu.util; package cn.qaiu.util;
public interface JsContent { public interface JsContent {
String ye123 = """ String ye123 = "/*\n" +
/* " https://statics.123pan.com/share-static/dist/umi.fb72555e.js\n" +
https://statics.123pan.com/share-static/dist/umi.fb72555e.js " eaefamemdead\n" +
eaefamemdead " eaefameidldy\n" +
eaefameidldy " _0x4f141a(1690439821|5790548|/b/api/share/download/info|web|3|1946841013) = 秘钥\n" +
_0x4f141a(1690439821|5790548|/b/api/share/download/info|web|3|1946841013) = 秘钥 " \n" +
" _0x1e2592 1690439821 时间戳\n" +
_0x1e2592 1690439821 时间戳 " _0x48562f 5790548 随机码\n" +
_0x48562f 5790548 随机码 " _0x1e37d5 /b/api/share/download/info\n" +
_0x1e37d5 /b/api/share/download/info " _0x4e2d74 web\n" +
_0x4e2d74 web " _0x56f040 3\n" +
_0x56f040 3 " _0x43bdc6 1946841013 加密时间HASH戳\n" +
_0x43bdc6 1946841013 加密时间HASH戳 " \n" +
" >>>>\n" +
>>>> " _0x43bdc6=''['concat'](_0x1e2592, '-')['concat'](_0x48562f, '-')['concat'](_0x406c4e)\n" +
_0x43bdc6=''['concat'](_0x1e2592, '-')['concat'](_0x48562f, '-')['concat'](_0x406c4e) " 加密时间HASH戳 = 时间戳-随机码-秘钥\n" +
加密时间HASH戳 = 时间戳-随机码-秘钥 " */\n" +
*/ " \n" +
" function _0x1b5d95(_0x278d1a) {\n" +
function _0x1b5d95(_0x278d1a) { " var _0x839b57,\n" +
var _0x839b57, " _0x4ed4dc = arguments['length'] > 0x2 && void 0x0 !== arguments[0x2] ? arguments[0x2] : " +
_0x4ed4dc = arguments['length'] > 0x2 && void 0x0 !== arguments[0x2] ? arguments[0x2] : 0x8; "0x8;\n" +
if (0x0 === arguments['length']) " if (0x0 === arguments['length'])\n" +
return null; " return null;\n" +
'object' === typeof _0x278d1a ? _0x839b57 = _0x278d1a : (0xa === ('' + _0x278d1a)['length'] && (_0x278d1a = 0x3e8 * parseInt(_0x278d1a)), " 'object' === typeof _0x278d1a ? _0x839b57 = _0x278d1a : (0xa === ('' + _0x278d1a)" +
_0x839b57 = new Date(_0x278d1a)); "['length'] && (_0x278d1a = 0x3e8 * parseInt(_0x278d1a)),\n" +
var _0xc5c54a = _0x278d1a + 0xea60 * new Date(_0x278d1a)['getTimezoneOffset']() " _0x839b57 = new Date(_0x278d1a));\n" +
, _0x3732dc = _0xc5c54a + 0x36ee80 * _0x4ed4dc; " var _0xc5c54a = _0x278d1a + 0xea60 * new Date(_0x278d1a)['getTimezoneOffset']()\n" +
return _0x839b57 = new Date(_0x3732dc), " , _0x3732dc = _0xc5c54a + 0x36ee80 * _0x4ed4dc;\n" +
{ " return _0x839b57 = new Date(_0x3732dc),\n" +
'y': _0x839b57['getFullYear'](), " {\n" +
'm': _0x839b57['getMonth']() + 0x1 < 0xa ? '0' + (_0x839b57['getMonth']() + 0x1) : _0x839b57['getMonth']() + 0x1, " 'y': _0x839b57['getFullYear'](),\n" +
'd': _0x839b57['getDate']() < 0xa ? '0' + _0x839b57['getDate']() : _0x839b57['getDate'](), " 'm': _0x839b57['getMonth']() + 0x1 < 0xa ? '0' + (_0x839b57['getMonth']() + 0x1) : " +
'h': _0x839b57['getHours']() < 0xa ? '0' + _0x839b57['getHours']() : _0x839b57['getHours'](), "_0x839b57['getMonth']() + 0x1,\n" +
'f': _0x839b57['getMinutes']() < 0xa ? '0' + _0x839b57['getMinutes']() : _0x839b57['getMinutes']() " 'd': _0x839b57['getDate']() < 0xa ? '0' + _0x839b57['getDate']() : " +
}; "_0x839b57['getDate'](),\n" +
} " 'h': _0x839b57['getHours']() < 0xa ? '0' + _0x839b57['getHours']() : " +
"_0x839b57['getHours'](),\n" +
" 'f': _0x839b57['getMinutes']() < 0xa ? '0' + _0x839b57['getMinutes']() : " +
function _0x4f141a(_0x4075b1) { "_0x839b57['getMinutes']()\n" +
" };\n" +
for (var _0x4eddcb = arguments['length'] > 0x1 && void 0x0 !== arguments[0x1] ? arguments[0x1] : 0xa, " }\n" +
_0x2fc680 = function() { " \n" +
for (var _0x515c63, _0x361314 = [], _0x4cbdba = 0x0; _0x4cbdba < 0x100; _0x4cbdba++) { " \n" +
_0x515c63 = _0x4cbdba; " function _0x4f141a(_0x4075b1) {\n" +
for (var _0x460960 = 0x0; _0x460960 < 0x8; _0x460960++) " \n" +
_0x515c63 = 0x1 & _0x515c63 ? 0xedb88320 ^ _0x515c63 >>> 0x1 : _0x515c63 >>> 0x1; " for (var _0x4eddcb = arguments['length'] > 0x1 && void 0x0 !== arguments[0x1] ? " +
_0x361314[_0x4cbdba] = _0x515c63; "arguments[0x1] : 0xa,\n" +
} " _0x2fc680 = function() {\n" +
return _0x361314; " for (var _0x515c63, _0x361314 = [], _0x4cbdba = 0x0; _0x4cbdba < 0x100; _0x4cbdba++) " +
}, "{\n" +
_0x4aed86 = _0x2fc680(), " _0x515c63 = _0x4cbdba;\n" +
_0x5880f0 = _0x4075b1, " for (var _0x460960 = 0x0; _0x460960 < 0x8; _0x460960++)\n" +
_0x492393 = -0x1, _0x25d82c = 0x0; " _0x515c63 = 0x1 & _0x515c63 ? 0xedb88320 ^ _0x515c63 >>> 0x1 : _0x515c63 >>> 0x1;" +
_0x25d82c < _0x5880f0['length']; "\n" +
_0x25d82c++) " _0x361314[_0x4cbdba] = _0x515c63;\n" +
" }\n" +
_0x492393 = _0x492393 >>> 0x8 ^ _0x4aed86[0xff & (_0x492393 ^ _0x5880f0.charCodeAt(_0x25d82c))]; " return _0x361314;\n" +
return _0x492393 = (-0x1 ^ _0x492393) >>> 0x0, " },\n" +
_0x492393.toString(_0x4eddcb); " _0x4aed86 = _0x2fc680(),\n" +
} " _0x5880f0 = _0x4075b1,\n" +
" _0x492393 = -0x1, _0x25d82c = 0x0;\n" +
" _0x25d82c < _0x5880f0['length'];\n" +
function getSign(_0x1e37d5) { " _0x25d82c++)\n" +
var _0x4e2d74 = 'web'; " \n" +
var _0x56f040 = 3; " _0x492393 = _0x492393 >>> 0x8 ^ _0x4aed86[0xff & (_0x492393 ^ _0x5880f0.charCodeAt" +
var _0x1e2592 = Math.round((new Date().getTime() + 0x3c * new Date().getTimezoneOffset() * 0x3e8 + 28800000) / 0x3e8).toString(); "(_0x25d82c))];\n" +
var key = 'a,d,e,f,g,h,l,m,y,i,j,n,o,p,k,q,r,s,t,u,b,c,v,w,s,z'; " return _0x492393 = (-0x1 ^ _0x492393) >>> 0x0,\n" +
var _0x48562f = Math['round'](0x989680 * Math['random']()); " _0x492393.toString(_0x4eddcb);\n" +
" }\n" +
var _0x2f7dfc; " \n" +
var _0x35a889; " \n" +
var _0x36f983; " function getSign(_0x1e37d5) {\n" +
var _0x3b043d; " var _0x4e2d74 = 'web';\n" +
var _0x5bc73b; " var _0x56f040 = 3;\n" +
var _0x4b30b2; " var _0x1e2592 = Math.round((new Date().getTime() + 0x3c * new Date().getTimezoneOffset() *" +
var _0x32399e; " 0x3e8 + 28800000) / 0x3e8).toString();\n" +
var _0x25d94e; " var key = 'a,d,e,f,g,h,l,m,y,i,j,n,o,p,k,q,r,s,t,u,b,c,v,w,s,z';\n" +
var _0x373490; " var _0x48562f = Math['round'](0x989680 * Math['random']());\n" +
for (var _0x1c540f in (_0x2f7dfc = key.split(','), " \n" +
_0x35a889 = _0x1b5d95(_0x1e2592), " var _0x2f7dfc;\n" +
_0x36f983 = _0x35a889['y'], " var _0x35a889;\n" +
_0x3b043d = _0x35a889['m'], " var _0x36f983;\n" +
_0x5bc73b = _0x35a889['d'], " var _0x3b043d;\n" +
_0x4b30b2 = _0x35a889['h'], " var _0x5bc73b;\n" +
_0x32399e = _0x35a889['f'], " var _0x4b30b2;\n" +
_0x25d94e = [_0x36f983, _0x3b043d, _0x5bc73b, _0x4b30b2, _0x32399e].join(''), " var _0x32399e;\n" +
_0x373490 = [], " var _0x25d94e;\n" +
_0x25d94e)) " var _0x373490;\n" +
_0x373490['push'](_0x2f7dfc[Number(_0x25d94e[_0x1c540f])]); " for (var _0x1c540f in (_0x2f7dfc = key.split(','),\n" +
var _0x43bdc6; " _0x35a889 = _0x1b5d95(_0x1e2592),\n" +
var _0x406c4e; " _0x36f983 = _0x35a889['y'],\n" +
return _0x43bdc6 = _0x4f141a(_0x373490['join']('')), " _0x3b043d = _0x35a889['m'],\n" +
_0x406c4e = _0x4f141a(''['concat'](_0x1e2592, '|')['concat'](_0x48562f, '|')['concat'](_0x1e37d5, '|')['concat'](_0x4e2d74, '|')['concat'](_0x56f040, '|')['concat'](_0x43bdc6)), " _0x5bc73b = _0x35a889['d'],\n" +
[_0x43bdc6, ''['concat'](_0x1e2592, '-')['concat'](_0x48562f, '-')['concat'](_0x406c4e)]; " _0x4b30b2 = _0x35a889['h'],\n" +
} " _0x32399e = _0x35a889['f'],\n" +
" _0x25d94e = [_0x36f983, _0x3b043d, _0x5bc73b, _0x4b30b2, _0x32399e].join(''),\n" +
"""; " _0x373490 = [],\n" +
String lz = """ " _0x25d94e))\n" +
/** " _0x373490['push'](_0x2f7dfc[Number(_0x25d94e[_0x1c540f])]);\n" +
* 蓝奏云解析器js签名获取工具 " var _0x43bdc6;\n" +
*/ " var _0x406c4e;\n" +
" return _0x43bdc6 = _0x4f141a(_0x373490['join']('')),\n" +
var signObj; " _0x406c4e = _0x4f141a(''['concat'](_0x1e2592, '|')['concat'](_0x48562f, '|')['concat']" +
"(_0x1e37d5, '|')['concat'](_0x4e2d74, '|')['concat'](_0x56f040, '|')['concat'](_0x43bdc6)),\n" +
" [_0x43bdc6, ''['concat'](_0x1e2592, '-')['concat'](_0x48562f, '-')['concat'](_0x406c4e)" +
var $, jQuery; "];\n" +
" }\n" +
$ = jQuery = function () { " ";
return new jQuery.fn.init(); String lz = "/**\n" +
} " * 蓝奏云解析器js签名获取工具\n" +
" */\n" +
jQuery.fn = jQuery.prototype = { " \n" +
init: function () { " var signObj;\n" +
return { " \n" +
focus: function (a) { " \n" +
" var $, jQuery;\n" +
}, " \n" +
keyup: function(a) { " $ = jQuery = function () {\n" +
" return new jQuery.fn.init();\n" +
}, " }\n" +
ajax: function (obj) { " \n" +
signObj = obj " jQuery.fn = jQuery.prototype = {\n" +
} " init: function () {\n" +
" return {\n" +
} " focus: function (a) {\n" +
}, " \n" +
" },\n" +
} " keyup: function(a) {\n" +
" \n" +
jQuery.fn.init.prototype = jQuery.fn; " },\n" +
" ajax: function (obj) {\n" +
" signObj = obj\n" +
// 伪装jquery.ajax函数获取关键数据 " }\n" +
$.ajax = function (obj) { " \n" +
signObj = obj " }\n" +
} " },\n" +
" \n" +
var document = { " }\n" +
getElementById: function (v) { " \n" +
return { " jQuery.fn.init.prototype = jQuery.fn;\n" +
value: 'v' " \n" +
} " \n" +
}, " // 伪装jquery.ajax函数获取关键数据\n" +
} " $.ajax = function (obj) {\n" +
" signObj = obj\n" +
"""; " }\n" +
" \n" +
" var document = {\n" +
" getElementById: function (v) {\n" +
" return {\n" +
" value: 'v'\n" +
" }\n" +
" },\n" +
" }";
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
package qaiu.web.test; package qaiu.web.test;
import cn.qaiu.util.AESUtils; import cn.qaiu.util.AESUtils;
import cn.qaiu.util.jdk17halper.HexFormat;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
@@ -9,7 +10,6 @@ import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException; import javax.crypto.NoSuchPaddingException;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.HexFormat;
public class TestAESUtil { public class TestAESUtil {

View File

@@ -9,10 +9,10 @@ public class TestRegex {
@Test @Test
public void regexYFC() { public void regexYFC() {
String html = """ String html = "\n" +
<input type="hidden" id="typed_id" value="file_559003251828"> " <input type=\"hidden\" id=\"typed_id\" value=\"file_559003251828\">\n" +
<input type="hidden" id="share_link_token" value="9cbe4b73521ba4d65a8cd38a8c"> " <input type=\"hidden\" id=\"share_link_token\" " +
"""; "value=\"9cbe4b73521ba4d65a8cd38a8c\">";
Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\""); Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\"");
Matcher matcher = compile.matcher(html); Matcher matcher = compile.matcher(html);

View File

@@ -15,9 +15,11 @@ public class TestWebClient2 {
public void matcherHtml() { public void matcherHtml() {
Pattern compile = Pattern.compile("class=\"ifr2\" name=.+src=\"(/fn\\?[a-zA-Z0-9_+/=]{16,})\""); Pattern compile = Pattern.compile("class=\"ifr2\" name=.+src=\"(/fn\\?[a-zA-Z0-9_+/=]{16,})\"");
var text = """ var text = "<div class=\"ifr\"><!--<iframe class=\"ifr2\" name=\"1\" src=\"/fn?v2\" frameborder=\"0\" " +
<div class="ifr"><!--<iframe class="ifr2" name="1" src="/fn?v2" frameborder="0" scrolling="no"></iframe>--> "scrolling=\"no\"></iframe>-->\n" +
<iframe class="ifr2" name="1685001208" src="/fn?UzUBa1oxBmUAYgNsUDUFNVI6BjJfJlchV21TZFU_aVWwANVQzXTBXMlUxUTcLZ1dwUn8DYwQ5AHFVOwdmBjRUPlM2AS9aOgY3AGIDMFA2" frameborder="0" scrolling="no"></iframe>"""; "<iframe class=\"ifr2\" name=\"1685001208\" " +
"src=\"/fn" +
"?UzUBa1oxBmUAYgNsUDUFNVI6BjJfJlchV21TZFU_aVWwANVQzXTBXMlUxUTcLZ1dwUn8DYwQ5AHFVOwdmBjRUPlM2AS9aOgY3AGIDMFA2\" frameborder=\"0\" scrolling=\"no\"></iframe>";
System.out.println(text); System.out.println(text);
Matcher matcher = compile.matcher(text); Matcher matcher = compile.matcher(text);
if (matcher.find()) { if (matcher.find()) {

39
pom.xml
View File

@@ -7,7 +7,7 @@
<groupId>cn.qaiu</groupId> <groupId>cn.qaiu</groupId>
<artifactId>netdisk-fast-download</artifactId> <artifactId>netdisk-fast-download</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>0.1.7</version> <version>${revision}</version>
<modules> <modules>
<module>core</module> <module>core</module>
@@ -17,9 +17,10 @@
</modules> </modules>
<properties> <properties>
<java.version>17</java.version> <revision>0.1.7</revision>
<maven.compiler.source>17</maven.compiler.source> <java.version>11</java.version>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<packageDirectory>${project.basedir}/web-service/target/package</packageDirectory> <packageDirectory>${project.basedir}/web-service/target/package</packageDirectory>
@@ -30,10 +31,40 @@
<lombok.version>1.18.12</lombok.version> <lombok.version>1.18.12</lombok.version>
<slf4j.version>2.0.5</slf4j.version> <slf4j.version>2.0.5</slf4j.version>
<commons-lang3.version>3.12.0</commons-lang3.version> <commons-lang3.version>3.12.0</commons-lang3.version>
<commons-beanutils2.version>2.0.0</commons-beanutils2.version>
<jackson.version>2.14.2</jackson.version> <jackson.version>2.14.2</jackson.version>
<logback.version>1.4.12</logback.version> <logback.version>1.4.12</logback.version>
</properties> </properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-dependencies</artifactId>
<version>${vertx.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>cn.qaiu</groupId>
<artifactId>core</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.qaiu</groupId>
<artifactId>core-database</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.qaiu</groupId>
<artifactId>parser</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,7 @@
"vue-template-compiler": "^2.6.14", "vue-template-compiler": "^2.6.14",
"compression-webpack-plugin": "^6.1.1", "compression-webpack-plugin": "^6.1.1",
"filemanager-webpack-plugin": "2.0.5" "filemanager-webpack-plugin": "8.0.0"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,

View File

@@ -5,15 +5,13 @@
<parent> <parent>
<artifactId>netdisk-fast-download</artifactId> <artifactId>netdisk-fast-download</artifactId>
<groupId>cn.qaiu</groupId> <groupId>cn.qaiu</groupId>
<version>0.1.7</version> <version>${revision}</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>0.1.7</version>
<artifactId>web-service</artifactId> <artifactId>web-service</artifactId>
<properties> <properties>
<packageDirectory>${project.basedir}/target/package</packageDirectory> <packageDirectory>${project.basedir}/target/package</packageDirectory>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<finalName>netdisk-fast-download</finalName> <finalName>netdisk-fast-download</finalName>
</properties> </properties>
@@ -22,7 +20,14 @@
<dependency> <dependency>
<groupId>cn.qaiu</groupId> <groupId>cn.qaiu</groupId>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<version>1.0.8</version> </dependency>
<dependency>
<groupId>cn.qaiu</groupId>
<artifactId>core-database</artifactId>
</dependency>
<dependency>
<groupId>cn.qaiu</groupId>
<artifactId>parser</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
@@ -47,16 +52,6 @@
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency>
<groupId>cn.qaiu</groupId>
<artifactId>core-database</artifactId>
<version>0.1.7</version>
</dependency>
<dependency>
<groupId>cn.qaiu</groupId>
<artifactId>parser</artifactId>
<version>0.1.7</version>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>

View File

@@ -47,12 +47,10 @@ public class DbServiceImpl implements DbService {
public Future<StatisticsInfo> getStatisticsInfo() { public Future<StatisticsInfo> getStatisticsInfo() {
JDBCPool client = JDBCPoolInit.instance().getPool(); JDBCPool client = JDBCPoolInit.instance().getPool();
Promise<StatisticsInfo> promise = Promise.promise(); Promise<StatisticsInfo> promise = Promise.promise();
String sql = """ String sql = "select COUNT(CASE \"code\" WHEN 500 THEN \"code\" END ) \"fail\",\n" +
select COUNT(CASE "code" WHEN 500 THEN "code" END ) "fail", " COUNT(CASE \"code\" WHEN 200 THEN \"code\" END ) \"success\",\n" +
COUNT(CASE "code" WHEN 200 THEN "code" END ) "success", " count(1) \"total\"\n" +
count(1) "total" " from \"t_parser_log_info\"";
from "t_parser_log_info"
""";
SqlTemplate.forQuery(client, sql).mapTo(StatisticsInfo.class).execute(new HashMap<>()).onSuccess(row -> { SqlTemplate.forQuery(client, sql).mapTo(StatisticsInfo.class).execute(new HashMap<>()).onSuccess(row -> {
StatisticsInfo info; StatisticsInfo info;
if ((info = row.iterator().next()) != null) { if ((info = row.iterator().next()) != null) {

View File

@@ -35,7 +35,7 @@ custom:
# 数据源配置 # 数据源配置
dataSource: dataSource:
provider_class: io.vertx.ext.jdbc.spi.impl.HikariCPDataSourceProvider provider_class: io.vertx.ext.jdbc.spi.impl.HikariCPDataSourceProvider
jdbcUrl: jdbc:h2:tcp://127.0.0.1:9095/./db/myData;MODE=MySQL;DATABASE_TO_UPPER=FALSE jdbcUrl: jdbc:h2:file:./db/nfdData;MODE=MySQL;DATABASE_TO_UPPER=FALSE
driverClassName: org.h2.Driver driverClassName: org.h2.Driver
username: root username: root
password: '123456' password: '123456'

View File

@@ -83,14 +83,10 @@ GET http://127.0.0.1:6400/parser?url=https://share.feijipan.com/s/nMtCOXL
### 小飞机盘 https://share.feijipan.com/s/laUshYGk ### 小飞机盘 https://share.feijipan.com/s/laUshYGk
# @no-redirect # @no-redirect
GET http://127.0.0.1:6400/parser?url=https://share.feijipan.com/s/laUshYGk GET http://127.0.0.1:6400/parser?url=https://share.feijipan.com/s/laUshYGk
### 小飞机盘 ### 小飞机盘 tIfhRqH
GET http://127.0.0.1:6400/json/fj/tIfhRqH GET http://127.0.0.1:6400/json/fj/tIfhRqH
### 小飞机盘 https://share.feijipan.com/s/7jy0zlv ### 小飞机盘 https://share.feijipan.com/s/7jy0zlv
GET http://127.0.0.1:6400/json/fj/7jy0zlv GET http://127.0.0.1:6400/json/fj/7jy0zlv
### 小飞机盘
# @no-redirect
GET http://127.0.0.1:6400/fj/tIfhRqH
### 小飞机盘 https://share.feijipan.com/s/nMtCOXL ### 小飞机盘 https://share.feijipan.com/s/nMtCOXL
# @no-redirect # @no-redirect
GET http://127.0.0.1:6400/fj/nMtCOXL GET http://127.0.0.1:6400/fj/nMtCOXL

View File

@@ -1,9 +1,9 @@
package cn.qaiu.web.test; package cn.qaiu.web.test;
import io.vertx.ext.web.RoutingContext; import io.vertx.ext.web.RoutingContext;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils2.BeanUtils;
import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils2.ConvertUtils;
import org.apache.commons.beanutils.Converter; import org.apache.commons.beanutils2.Converter;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.junit.Test; import org.junit.Test;

View File

@@ -9,10 +9,9 @@ public class TestRegex {
@Test @Test
public void regexYFC() { public void regexYFC() {
String html = """ String html = "<input type=\"hidden\" id=\"typed_id\" value=\"file_559003251828\">\n" +
<input type="hidden" id="typed_id" value="file_559003251828"> " <input type=\"hidden\" id=\"share_link_token\" " +
<input type="hidden" id="share_link_token" value="9cbe4b73521ba4d65a8cd38a8c"> "value=\"9cbe4b73521ba4d65a8cd38a8c\">";
""";
Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\""); Pattern compile = Pattern.compile("id=\"typed_id\"\\s+value=\"file_(\\d+)\"");
Matcher matcher = compile.matcher(html); Matcher matcher = compile.matcher(html);

View File

@@ -154,14 +154,14 @@ public class WebProxyExamples {
public static void main(String[] args) { public static void main(String[] args) {
final WebProxyExamples examples = new WebProxyExamples(); final WebProxyExamples examples = new WebProxyExamples();
examples.vertx.executeBlocking(rs -> { // examples.vertx.executeBlocking(rs -> {
rs.complete(); // rs.complete();
examples.origin(); // examples.origin();
}); // });
examples.vertx.executeBlocking(rs -> { // examples.vertx.executeBlocking(rs -> {
rs.complete(); // rs.complete();
examples.route(); // examples.route();
}); // });
System.out.println("ok"); System.out.println("ok");
} }