refactor(backend): 重命名后端项目为 gym-manage-api,修改包名为 cn.novalon.gym.manage

This commit is contained in:
张翔
2026-04-17 18:35:50 +08:00
parent 666189b676
commit deb961c427
916 changed files with 108360 additions and 38328 deletions
+31
View File
@@ -0,0 +1,31 @@
"""
认证 API 客户端
"""
from httpx import AsyncClient
class AuthAPI:
"""认证 API 客户端"""
def __init__(self, client: AsyncClient):
self.client = client
async def login(self, username: str, password: str):
"""登录"""
return await self.client.post('/api/auth/login', json={
'username': username,
'password': password
})
async def register(self, username: str, password: str, email: str):
"""注册"""
return await self.client.post('/api/auth/register', json={
'username': username,
'password': password,
'email': email
})
async def logout(self):
"""登出"""
return await self.client.post('/api/auth/logout')