20 lines
510 B
Python
20 lines
510 B
Python
|
from fastapi import APIRouter, WebSocket
|
||
|
|
||
|
from schemas import common as BaseSchema
|
||
|
from service import auth as AuthService
|
||
|
|
||
|
router = APIRouter(tags=["公共"])
|
||
|
|
||
|
|
||
|
LoginResult = BaseSchema.Response[BaseSchema.LoginResult]
|
||
|
|
||
|
|
||
|
@router.post("/login", summary="登录", response_model=LoginResult)
|
||
|
async def login(data: BaseSchema.LoginForm):
|
||
|
return await AuthService.user_login(data)
|
||
|
|
||
|
|
||
|
@router.websocket("/ws", name="系统信息")
|
||
|
async def get_system_info(ws: WebSocket):
|
||
|
await AuthService.system_info(ws)
|