feat(交易记录): 新增交易记录管理页面与API接口 feat(上传): 添加统一上传接口支持自动识别文件类型 feat(用户管理): 为用户模型添加备注字段并更新相关接口 feat(邮件): 实现SMTP邮件发送功能并添加测试脚本 feat(短信): 增强短信服务配置灵活性与日志记录 fix(发票): 修复发票列表时间筛选功能 fix(nginx): 调整上传大小限制与超时配置 docs: 添加多个功能模块的说明文档 docs(估值): 补充估值计算流程与API提交数据说明 chore: 更新依赖与Docker镜像版本
41 lines
2.2 KiB
Python
41 lines
2.2 KiB
Python
from tortoise import fields
|
|
|
|
from app.schemas.menus import MenuType
|
|
|
|
from .base import BaseModel, TimestampMixin
|
|
from .enums import MethodType
|
|
|
|
|
|
class AppUser(BaseModel, TimestampMixin):
|
|
username = fields.CharField(max_length=20, unique=True, null=True, description="用户名称", index=True)
|
|
alias = fields.CharField(max_length=30, null=True, description="姓名", index=True)
|
|
email = fields.CharField(max_length=255, unique=True, null=True, description="邮箱", index=True)
|
|
phone = fields.CharField(max_length=20, unique=True, description="手机号", index=True)
|
|
password = fields.CharField(max_length=128, description="密码")
|
|
company_name = fields.CharField(max_length=100, null=True, description="公司名称", index=True)
|
|
company_address = fields.CharField(max_length=255, null=True, description="公司地址")
|
|
company_contact = fields.CharField(max_length=50, null=True, description="公司联系人")
|
|
company_phone = fields.CharField(max_length=20, null=True, description="公司电话")
|
|
company_email = fields.CharField(max_length=100, null=True, description="公司邮箱")
|
|
is_active = fields.BooleanField(default=True, description="是否激活", index=True)
|
|
last_login = fields.DatetimeField(null=True, description="最后登录时间", index=True)
|
|
remaining_quota = fields.IntField(default=0, description="剩余估值次数", index=True)
|
|
notes = fields.CharField(max_length=256, null=True, description="备注")
|
|
|
|
class Meta:
|
|
table = "app_user"
|
|
table_description = "用户表"
|
|
|
|
|
|
class AppUserQuotaLog(BaseModel, TimestampMixin):
|
|
app_user_id = fields.IntField(description="App用户ID", index=True)
|
|
operator_id = fields.IntField(description="操作人ID", index=True)
|
|
operator_name = fields.CharField(max_length=64, description="操作人")
|
|
before_count = fields.IntField(description="变更前次数")
|
|
after_count = fields.IntField(description="变更后次数")
|
|
op_type = fields.CharField(max_length=32, description="操作类型")
|
|
remark = fields.CharField(max_length=256, null=True, description="备注")
|
|
|
|
class Meta:
|
|
table = "app_user_quota_log"
|
|
table_description = "App用户估值次数操作日志" |