diff --git a/app/core/config.py b/app/core/config.py index 0acbed2..5162934 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -1182,9 +1182,9 @@ class AppConfig(GlobalConfig): overview = {} for user, data in history_data.items(): last_proxy_date = max( - datetime.strptime(_["date"], "%d日 %H:%M:%S") + datetime.strptime(_["date"], "%Y年%m月%d日 %H:%M:%S") for _ in data.get("index", []) - ).strftime("%d日 %H:%M:%S") + ).strftime("%Y年%m月%d日 %H:%M:%S") proxy_times = len(data.get("index", [])) error_info = data.get("error_info", {}) error_times = len(error_info) @@ -1642,12 +1642,12 @@ class AppConfig(GlobalConfig): if single_data[key] != "Success!": if "error_info" not in data: data["error_info"] = {} - data["error_info"][actual_date.strftime("%d日 %H:%M:%S")] = ( - single_data[key] - ) + data["error_info"][ + actual_date.strftime("%Y年%m月%d日 %H:%M:%S") + ] = single_data[key] data["index"][actual_date] = { - "date": actual_date.strftime("%d日 %H:%M:%S"), + "date": actual_date.strftime("%Y年%m月%d日 %H:%M:%S"), "status": ( "完成" if single_data[key] == "Success!" else "异常" ), diff --git a/app/models/schema.py b/app/models/schema.py index a3e9e5e..e7bf0d4 100644 --- a/app/models/schema.py +++ b/app/models/schema.py @@ -663,7 +663,7 @@ class TaskMessage(BaseModel): class HistorySearchIn(BaseModel): - mode: Literal["按日合并", "按周合并", "按年月并"] = Field( + mode: Literal["按日合并", "按周合并", "按月合并"] = Field( ..., description="合并模式" ) start_date: str = Field(..., description="开始日期, 格式YYYY-MM-DD")