统一前后端时间时区请求
This commit is contained in:
@@ -313,8 +313,7 @@ def test_simulation_run_translates_rfc3339(monkeypatch):
|
||||
assert result.exit_code == 0
|
||||
assert captured["json"] == {
|
||||
"name": "demo",
|
||||
"simulation_date": "2025-01-02",
|
||||
"start_time": "03:04:05+08:00",
|
||||
"start_time": "2025-01-02T03:04:05+08:00",
|
||||
"duration": 30,
|
||||
}
|
||||
assert "tjwater-cli data timeseries realtime links" in result.stdout
|
||||
|
||||
@@ -45,8 +45,7 @@ def simulation_run(
|
||||
end_time = (parsed + timedelta(minutes=duration)).isoformat()
|
||||
body = {
|
||||
"name": network,
|
||||
"simulation_date": parsed.date().isoformat(),
|
||||
"start_time": parsed.timetz().replace(microsecond=0).isoformat(),
|
||||
"start_time": parsed.replace(microsecond=0).isoformat(),
|
||||
"duration": duration,
|
||||
}
|
||||
emit_api(
|
||||
|
||||
@@ -102,7 +102,7 @@ COMMAND_DOCS: dict[tuple[str, ...], CommandDoc] = {
|
||||
("simulation", "run"): CommandDoc(
|
||||
path=("simulation", "run"),
|
||||
summary="触发指定绝对时间的模拟运行",
|
||||
description="把 RFC3339 start-time 拆成 simulation_date 与 start_time 后调用 /runsimulationmanuallybydate/;接口本身只负责触发运行,结果需后续通过 data timeseries 在对应时间段查询。",
|
||||
description="把显式带时区的 RFC3339 start-time 直接传给 /runsimulationmanuallybydate/;服务端按带时区时间处理并统一按 UTC 存储结果,实时数据需后续通过 data timeseries 在对应时间段查询。",
|
||||
options=(
|
||||
CommandOptionDoc("start-time", "显式带时区的开始时间", required=True),
|
||||
CommandOptionDoc("duration", "持续分钟数", required=True),
|
||||
|
||||
Reference in New Issue
Block a user