|
@@ -281,6 +281,10 @@ public class MonitorServiceImpl implements MonitorService {
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
LocalDateTime threshold;
|
|
LocalDateTime threshold;
|
|
|
|
|
|
|
|
|
|
+ if (s == null) {
|
|
|
|
|
+ s = "1w"; // 默认值
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
switch (s) {
|
|
switch (s) {
|
|
|
case "1d":
|
|
case "1d":
|
|
|
threshold = now.minusDays(1);
|
|
threshold = now.minusDays(1);
|
|
@@ -289,12 +293,14 @@ public class MonitorServiceImpl implements MonitorService {
|
|
|
threshold = now.minusDays(3);
|
|
threshold = now.minusDays(3);
|
|
|
break;
|
|
break;
|
|
|
case "1w":
|
|
case "1w":
|
|
|
- default:
|
|
|
|
|
threshold = now.minusWeeks(1);
|
|
threshold = now.minusWeeks(1);
|
|
|
break;
|
|
break;
|
|
|
case "1m":
|
|
case "1m":
|
|
|
threshold = now.minusMonths(1);
|
|
threshold = now.minusMonths(1);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ threshold = now.minusWeeks(1); // 默认值
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 直接传递LocalDateTime或格式化字符串(根据数据库支持选择)
|
|
// 直接传递LocalDateTime或格式化字符串(根据数据库支持选择)
|