Files
fastapi-best-architecture/backend/app/schemas/login_log.py
T
Wu Clan 4e4c6fbe95 add login logs (#76)
* simplify crud method naming

* update get_user_list to get_select

* add sign in logs

* Perform pre-commit fix

* Encapsulated request ip address resolution

* Delete login log records for uncertain exceptions

* Add login log deletion interface

* Add login logging to background tasks

* update the user agent parse
2023-05-27 22:55:25 +08:00

34 lines
509 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import datetime
from pydantic import BaseModel
class LoginLogBase(BaseModel):
user_uuid: str
username: str
status: int
ipaddr: str
location: str
browser: str
os: str
msg: str
login_time: datetime
class CreateLoginLog(LoginLogBase):
pass
class UpdateLoginLog(LoginLogBase):
pass
class GetAllLoginLog(LoginLogBase):
id: int
create_time: datetime
class Config:
orm_mode = True