mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 21:15:13 +00:00
* 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
34 lines
509 B
Python
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
|