
- Updated import statements in `mooc/models/__init__.py` to use parentheses for clarity. - Refactored `mooc/models/core.py` to replace `UnsignedInteger` with `INTEGER(unsigned=True)` for better compatibility. - Introduced new `MobileNumber` model in `mooc/models/mobile_number.py` with appropriate fields. - Added `ProfileFields` model in `mooc/models/profile_fields.py` with detailed attributes. - Updated schemas in `mooc/schemas/mobile_number.py` and `mooc/schemas/profile_fields.py` to reflect model changes and improve naming conventions. - Ensured all models and schemas are consistent with naming and data types.
67 lines
1.1 KiB
Python
67 lines
1.1 KiB
Python
from pydantic import BaseModel
|
|
|
|
class ProfileFieldsBase(BaseModel):
|
|
field: str
|
|
available: bool
|
|
title: str
|
|
description: str
|
|
displayorder: int
|
|
required: bool
|
|
unchangeable: bool
|
|
showinregister: bool
|
|
field_length: int
|
|
|
|
class ProfileFieldsCreate(ProfileFieldsBase):
|
|
pass
|
|
|
|
class ProfileFields(ProfileFieldsBase):
|
|
id: int
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class QrcodeBase(BaseModel):
|
|
Uniacid: int
|
|
Acid: int
|
|
Type: str
|
|
Extra: int
|
|
Qrcid: int
|
|
SceneStr: str
|
|
Name: str
|
|
Keyword: str
|
|
Model: int
|
|
Ticket: str
|
|
Url: str
|
|
Expire: int
|
|
Subnum: int
|
|
Createtime: int
|
|
Status: int
|
|
|
|
class QrcodeCreate(QrcodeBase):
|
|
pass
|
|
|
|
class Qrcode(QrcodeBase):
|
|
Id: int
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
class QrcodeStatBase(BaseModel):
|
|
Uniacid: int
|
|
Acid: int
|
|
Qid: int
|
|
Openid: str
|
|
Type: int
|
|
Qrcid: int
|
|
SceneStr: str
|
|
Name: str
|
|
Createtime: int
|
|
|
|
class QrcodeStatCreate(QrcodeStatBase):
|
|
pass
|
|
|
|
class QrcodeStat(QrcodeStatBase):
|
|
Id: int
|
|
|
|
class Config:
|
|
orm_mode = True |