mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-02 09:26:12 +08:00
✨ web api 更新
This commit is contained in:
parent
d890d32bba
commit
c85e77c801
@ -202,7 +202,7 @@ async def update_weigth_config(platformName: str, target: str, weight_config: We
|
||||
|
||||
|
||||
@router.get("/cookie", dependencies=[Depends(check_is_superuser)])
|
||||
async def get_cookie() -> list[Cookie]:
|
||||
async def get_cookie(site_name: str = None, target: str = None) -> list[Cookie]:
|
||||
pass
|
||||
|
||||
|
||||
@ -211,21 +211,21 @@ async def add_cookie(site_name: str, content: str) -> StatusResp:
|
||||
pass
|
||||
|
||||
|
||||
@router.delete("/cookie", dependencies=[Depends(check_is_superuser)])
|
||||
async def del_cookie(site_name: str, content: str) -> StatusResp:
|
||||
@router.delete("/cookie/{cookie_id}", dependencies=[Depends(check_is_superuser)])
|
||||
async def del_cookie(cookie_id: int) -> StatusResp:
|
||||
pass
|
||||
|
||||
|
||||
@router.get("/cookie_target", dependencies=[Depends(check_is_superuser)])
|
||||
async def get_cookie_target() -> list[CookieTarget]:
|
||||
async def get_cookie_target(site_name: str = None, target: str = None, cookie_id: int = None) -> list[CookieTarget]:
|
||||
pass
|
||||
|
||||
|
||||
@router.post("/cookie_target", dependencies=[Depends(check_is_superuser)])
|
||||
async def add_cookie_target(site_name: str, target: str) -> StatusResp:
|
||||
async def add_cookie_target(site_name: str, target: str, cookie_id: int) -> StatusResp:
|
||||
pass
|
||||
|
||||
|
||||
@router.delete("/cookie_target", dependencies=[Depends(check_is_superuser)])
|
||||
async def del_cookie_target(site_name: str, target: str) -> StatusResp:
|
||||
async def del_cookie_target(site_name: str, target: str, cookie_id: int) -> StatusResp:
|
||||
pass
|
||||
|
@ -71,11 +71,9 @@ class Target(BaseModel):
|
||||
target_name: str
|
||||
target: str
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class Cookie(BaseModel):
|
||||
id: int
|
||||
site_name: str
|
||||
friendly_name: str
|
||||
last_usage: datetime
|
||||
@ -85,13 +83,7 @@ class Cookie(BaseModel):
|
||||
is_anonymous: bool
|
||||
tags: dict[str, Any]
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class CookieTarget(BaseModel):
|
||||
target: Target
|
||||
cookie: Cookie
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
cookie_id: int
|
||||
|
Loading…
x
Reference in New Issue
Block a user