feat(site): add POST /site/cookie/{site_id} endpoint for updating site Cookie&UA via request body

- Introduce SiteCookieUpdate schema for structured cookie update requests
- Add POST endpoint to update site Cookie&UA using JSON body
- Refactor cookie update logic into shared _update_site_cookie function
- Update SKILL.md to document new endpoint and endpoint count
- Add tests for both POST and legacy GET cookie update endpoints
This commit is contained in:
jxxghp
2026-05-31 09:11:09 +08:00
parent ac09ce5230
commit 16ada1a6c4
4 changed files with 139 additions and 14 deletions
+9
View File
@@ -115,6 +115,15 @@ class SiteAuth(BaseModel):
params: Optional[Dict[str, Union[int, str]]] = Field(default_factory=dict)
class SiteCookieUpdate(BaseModel):
"""
站点 Cookie 与 UA 更新请求。
"""
username: str = Field(..., description="站点登录用户名")
password: str = Field(..., description="站点登录密码")
code: Optional[str] = Field(None, description="二步验证码或密钥")
class SiteCategory(BaseModel):
id: Optional[int] = None
cat: Optional[str] = None