新增用户应用管理

This commit is contained in:
18610128193
2026-06-10 10:39:37 +08:00
parent bec4f6b419
commit d8bfebdcfb
6 changed files with 292 additions and 0 deletions
@@ -0,0 +1,27 @@
from sqlalchemy import BigInteger, ForeignKey, String
from sqlalchemy.orm import Mapped, mapped_column
from app.models.base import Base, TimestampMixin, SoftDeleteMixin
class UserOAuthApp(Base, TimestampMixin, SoftDeleteMixin):
__tablename__ = "user_oauth_app"
id: Mapped[str] = mapped_column(
String(32), primary_key=True, comment="主键"
)
app_id: Mapped[str] = mapped_column(
String(64), unique=True, nullable=False, index=True, comment="应用id"
)
secret: Mapped[str] = mapped_column(
String(256), nullable=False, comment="应用密钥"
)
status: Mapped[int] = mapped_column(
BigInteger, nullable=False, default=1, comment="状态,1=正常,2=禁用"
)
open_type: Mapped[int] = mapped_column(
BigInteger, nullable=False, index=True, comment="开户方式(1=千川,2=广告,3=本地推,4=星图,5=快手代理商,6=巨量星图,7=巨量服务单,8=腾讯服务单,9=腾讯营销K2,10=腾讯营销K3)"
)
create_by: Mapped[str | None] = mapped_column(
String(32), ForeignKey("users.id", ondelete="SET NULL"), nullable=True, comment="创建者"
)