jdk11兼容

This commit is contained in:
QAIU
2024-06-19 09:51:08 +08:00
parent 966417f867
commit 9ded137539
20 changed files with 1312 additions and 224 deletions

View File

@@ -12,7 +12,6 @@
<properties>
<packageDirectory>${project.basedir}/target/package</packageDirectory>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<finalName>netdisk-fast-download</finalName>
</properties>

View File

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

View File

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

View File

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