mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2026-03-13 09:31:31 +08:00
21 lines
732 B
Python
21 lines
732 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
from sqlalchemy import String
|
|
from sqlalchemy.dialects.mysql import LONGTEXT
|
|
from sqlalchemy.dialects.postgresql import TEXT
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from backend.common.model import Base, id_key
|
|
|
|
|
|
class Api(Base):
|
|
"""API 表"""
|
|
|
|
__tablename__ = 'sys_api'
|
|
|
|
id: Mapped[id_key] = mapped_column(init=False)
|
|
name: Mapped[str] = mapped_column(String(50), unique=True, comment='API 名称')
|
|
method: Mapped[str] = mapped_column(String(16), comment='请求方法')
|
|
path: Mapped[str] = mapped_column(String(500), comment='API 路径')
|
|
remark: Mapped[str | None] = mapped_column(LONGTEXT().with_variant(TEXT, 'postgresql'), comment='备注')
|