From d7566945346e6f5e51920bb401db3fa5f4105949 Mon Sep 17 00:00:00 2001 From: Milky0217 Date: Sat, 18 Apr 2026 13:24:07 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=20API=20=E6=96=87?= =?UTF-8?q?=E6=A1=A3=EF=BC=8C=E6=BE=84=E6=B8=85=20get=5Fweather=5Fdetails?= =?UTF-8?q?=20=E6=94=AF=E6=8C=81=E5=8F=8C=E8=AE=A4=E8=AF=81=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 说明 get_weather_details 同时支持 JWT 和 temp_token - 更新路由注册注释 --- AGENTS.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 62595a5..51345b2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -109,14 +109,13 @@ title, date, hour, min, longitude, latitude, ... ### 公开接口(无需认证) - `POST /api/login` — 微信登录 -- `GET /weather/details?temp_token=...` — 通过临时令牌访问 +- `GET /weather/details` — 获取天气详情(支持 JWT 或 temp_token,详见下文) - `GET /static/{tail:*}` — 静态文件 ### 受保护接口(需要 JWT) - `POST /api/post-weather-data` — 上传天气数据(带配额检查) - `GET /api/user/profile` — 获取当前用户信息(付费状态、管理员标识) - `GET /weather` — 分页列出用户的天气数据 -- `GET /weather/details?id=...` — 获取天气详情(JWT 认证) - `POST /api/generate-temp-token/{resource_id}` — 生成 10 分钟分享令牌 - `DELETE /weather/delete/{id}` — 删除天气记录 @@ -293,7 +292,7 @@ App::new() .app_data(web::Data::new(app_state)) // 公开接口(无 middleware) .service(login) // POST /api/login - .service(get_weather_details) // GET /api/weather/details + .service(get_weather_details) // GET /weather/details(支持 JWT 或 temp_token) // 受保护接口(JWT middleware) .service( web::scope("")