Files
fastapi-best-architecture/backend/app/admin/model/api.py
T
Wu Clan bd45022a59 Update role-based data permissions (#465)
* Add department data operation permissions

* Update sys models

* Add role department many-to-many relationship

* Format RBAC code

* update codes

* add update role depts api

* add comments

* Update the implementation

* update dept arg

* debug front

* Update the model file naming

* Refactor the data perms

* Add data permission rule

* Optimize the details

* Implement data filtering

* finish
2024-11-23 21:23:52 +08:00

20 lines
649 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sqlalchemy import String
from sqlalchemy.dialects.mysql import LONGTEXT
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, comment='备注')