fix(model): User的gender类型可为空
This commit is contained in:
@@ -57,7 +57,7 @@ def upgrade() -> None:
|
||||
op.create_table('system_users',
|
||||
sa.Column('user_id', sa.Integer(), autoincrement=True, nullable=False, comment='用户id'),
|
||||
sa.Column('nickname', sa.String(length=20), nullable=False, comment='昵称'),
|
||||
sa.Column('gender', sa.Integer(), nullable=False, comment='性别'),
|
||||
sa.Column('gender', sa.Integer(), nullable=True, comment='性别'),
|
||||
sa.Column('avatar_url', sa.String(length=500), nullable=False, comment='头像链接'),
|
||||
sa.Column('wechat_openid', sa.String(length=100), nullable=False, comment='微信openid'),
|
||||
sa.Column('wechat_union_id', sa.String(length=100), nullable=True, comment='微信unionid'),
|
||||
|
||||
@@ -68,7 +68,7 @@ class User(BaseModel, DateModel):
|
||||
comment='用户id'
|
||||
)
|
||||
nickname: Mapped[str] = mapped_column(String(20), comment='昵称')
|
||||
gender: Mapped[int] = mapped_column(Integer, comment='性别')
|
||||
gender: Mapped[int] = mapped_column(Integer, nullable=True, comment='性别')
|
||||
avatar_url: Mapped[str] = mapped_column(String(500), comment='头像链接')
|
||||
wechat_openid: Mapped[str] = mapped_column(String(100), comment='微信openid')
|
||||
wechat_union_id: Mapped[str] = mapped_column(String(100), nullable=True, comment='微信unionid')
|
||||
|
||||
@@ -96,7 +96,7 @@ async def wechat_login(
|
||||
'wechat_openid': openid,
|
||||
'wechat_union_id': union_id,
|
||||
'phone': payload.phone,
|
||||
'avatar_url': payload.avatar_url
|
||||
'avatar_url': payload.avatar_url,
|
||||
},
|
||||
filters={'wechat_openid': openid}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user