Add os and browser parameters to opera log (#97)

This commit is contained in:
Wu Clan
2023-06-06 10:09:43 +08:00
committed by GitHub
parent e728a0389b
commit bddbf3a1d8
3 changed files with 6 additions and 0 deletions

View File

@ -102,6 +102,8 @@ class OperaLogMiddleware:
path=path, path=path,
ipaddr=ip, ipaddr=ip,
location=location, location=location,
os=os,
browser=browser,
args=args, args=args,
status=status, status=status,
code=code, code=code,

View File

@ -21,6 +21,8 @@ class OperaLog(DataClassBase):
path: Mapped[str] = mapped_column(String(500), comment='请求路径') path: Mapped[str] = mapped_column(String(500), comment='请求路径')
ipaddr: Mapped[str] = mapped_column(String(50), comment='IP地址') ipaddr: Mapped[str] = mapped_column(String(50), comment='IP地址')
location: Mapped[str] = mapped_column(String(50), comment='归属地') location: Mapped[str] = mapped_column(String(50), comment='归属地')
os: Mapped[str] = mapped_column(String(50), comment='操作系统')
browser: Mapped[str] = mapped_column(String(50), comment='浏览器')
args: Mapped[str | None] = mapped_column(JSON(), comment='请求参数') args: Mapped[str | None] = mapped_column(JSON(), comment='请求参数')
status: Mapped[bool] = mapped_column(comment='操作状态0异常 1正常') status: Mapped[bool] = mapped_column(comment='操作状态0异常 1正常')
code: Mapped[int] = mapped_column(insert_default=200, comment='操作状态码') code: Mapped[int] = mapped_column(insert_default=200, comment='操作状态码')

View File

@ -12,6 +12,8 @@ class OperaLogBase(BaseModel):
path: str path: str
ipaddr: str ipaddr: str
location: str location: str
os: str
browser: str
args: str | None args: str | None
status: bool status: bool
code: int code: int