feat: 今天环境条新增下一个倒数日、浙江油价、上证指数、降雨/AQI
- 后端新增三源:中石化浙江油价(3步会话)、新浪上证行情、Open-Meteo 空气质量(国标AQI换算),按源独立超时与状态 - 天气行改为 降雨概率% · AQI 等级(无雨无AQI时保留观测时间),stale 补缓存标记 - 前端 strip 六格两行(桌面)/四行(移动),倒数日取本地缓存最近一条,超12字截断 - 修复两处 AppSheet 动画竞态存量 e2e 失败(modal contract footer 时序、scrollable 重开残留 dialog)
This commit is contained in:
+9
-1
@@ -74,6 +74,7 @@ from .schemas import (
|
||||
UserUpdate,
|
||||
)
|
||||
from .today_environment import get_environment as get_today_environment
|
||||
from .today_environment import get_environment_extras as get_today_environment_extras
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
@@ -216,7 +217,14 @@ async def me(user: User = Depends(current_user)):
|
||||
|
||||
@app.get("/api/v1/today/environment")
|
||||
async def today_environment(_: User = Depends(current_user)):
|
||||
return await get_today_environment()
|
||||
environment, extras = await asyncio.gather(
|
||||
get_today_environment(), get_today_environment_extras()
|
||||
)
|
||||
return {
|
||||
**{key: value for key, value in environment.items() if key != "errors"},
|
||||
**{key: value for key, value in extras.items() if key != "errors"},
|
||||
"errors": {**environment.get("errors", {}), **extras.get("errors", {})},
|
||||
}
|
||||
|
||||
|
||||
@app.patch("/api/v1/me", response_model=UserOut)
|
||||
|
||||
Reference in New Issue
Block a user