移除 mysql-connector-j;修正 ProcessBuilder 无法直接执行 Windows 上 node 安装的 mmdc
问题;修正因时区问题导致的 Statistics 统计方法不正确的问题
This commit is contained in:
5
pom.xml
5
pom.xml
@@ -143,11 +143,6 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.mysql/mysql-connector-j -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc -->
|
||||
<dependency>
|
||||
|
||||
@@ -14,7 +14,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jsoup.Jsoup;
|
||||
@@ -40,6 +39,7 @@ import me.qwq.doghouse.config.DoghouseProperties;
|
||||
import me.qwq.doghouse.pojo.bo.ThemeInfo;
|
||||
import me.qwq.doghouse.service.ThemeService;
|
||||
import me.qwq.doghouse.util.Cryptos;
|
||||
import me.qwq.doghouse.util.OSUtils;
|
||||
import me.qwq.doghouse.util.SpringContextHolder;
|
||||
|
||||
@Slf4j
|
||||
@@ -178,6 +178,13 @@ public class MermaidNodeRenderer implements NodeRenderer {
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
if (OSUtils.isWindows()) {
|
||||
cmd.addFirst("/C");
|
||||
cmd.addFirst("/S");
|
||||
cmd.addFirst("cmd.exe");
|
||||
}
|
||||
|
||||
ProcessBuilder pb = new ProcessBuilder(cmd);
|
||||
pb.redirectErrorStream(true);
|
||||
Process process = pb.start();
|
||||
@@ -224,7 +231,7 @@ public class MermaidNodeRenderer implements NodeRenderer {
|
||||
Files.delete(svgFilePath);
|
||||
renderPlainDiv(node, html, htmlOptions);
|
||||
}
|
||||
renderSvg(node, html, htmlOptions, Files.readString(svgFilePath));
|
||||
renderSvg(node, html, htmlOptions, svgContent);
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to load mermaid rendered svg: {}", svgFile.getPath(), e);
|
||||
renderPlainDiv(node, html, htmlOptions);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
),
|
||||
days AS (
|
||||
SELECT
|
||||
DATE('now', '-' || n || ' day') AS generatedDate
|
||||
DATE('now', 'localtime', '-' || n || ' day') AS generatedDate
|
||||
FROM numbers
|
||||
),
|
||||
post_data AS (
|
||||
@@ -23,7 +23,7 @@
|
||||
COUNT(post_id) AS postCount
|
||||
FROM post
|
||||
WHERE
|
||||
DATE(create_time) >= DATE('now', '-' || #{passDays} || ' day')
|
||||
DATE(create_time) >= DATE('now', 'localtime', '-' || #{passDays} || ' day')
|
||||
AND post_status = 0
|
||||
AND is_deleted = 0
|
||||
<if test="postType != null">
|
||||
@@ -37,7 +37,7 @@
|
||||
COUNT(id) AS commentCount
|
||||
FROM comment
|
||||
WHERE
|
||||
DATE(create_time) >= DATE('now', '-' || #{passDays} || ' day')
|
||||
DATE(create_time) >= DATE('now', 'localtime', '-' || #{passDays} || ' day')
|
||||
AND comment_status = 0
|
||||
AND is_deleted = 0
|
||||
GROUP BY DATE(create_time)
|
||||
|
||||
Reference in New Issue
Block a user