2022-09-16 12:32:51 +08:00

34 lines
822 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version : 1.0
# @Creaet Time : 2021/10/18 22:19
# @File : login.py
# @IDE : PyCharm
# @desc : pydantic 模型,用于数据库序列化操作
# pydantic 验证数据https://blog.csdn.net/qq_44291044/article/details/104693526
from typing import Optional, List
from pydantic import BaseModel
from core.validator import ValiDatetime
class LoginRecord(BaseModel):
telephone: str
status: bool
ip: Optional[str] = None
address: Optional[str] = None
browser: Optional[str] = None
system: Optional[str] = None
response: Optional[str] = None
class LoginRecordSimpleOut(LoginRecord):
id: int
create_datetime: ValiDatetime
update_datetime: ValiDatetime
class Config:
orm_mode = True