This commit is contained in:
+12
-1
@@ -39,4 +39,15 @@ async def subscribe_repo(req: SubscribeRequest):
|
||||
"message": f"✅ {req.target_name} geklont!",
|
||||
"path": str(target_dir),
|
||||
"success": True
|
||||
}
|
||||
}
|
||||
|
||||
@router.get("/repos")
|
||||
async def list_repos():
|
||||
from .main import GITEE_URL, get_token
|
||||
token = get_token()
|
||||
|
||||
headers = {"Authorization": f"token {token}"} if token else {}
|
||||
|
||||
async with httpx.AsyncClient() as client:
|
||||
resp = await client.get(f"{GITEE_URL}/api/v1/user/repos", headers=headers)
|
||||
return resp.json()
|
||||
Reference in New Issue
Block a user