增加path字段
This commit is contained in:
@@ -9,6 +9,7 @@ class FunctionList(Base):
|
|||||||
id = Column(BigInteger, primary_key=True, index=True, autoincrement=True)
|
id = Column(BigInteger, primary_key=True, index=True, autoincrement=True)
|
||||||
function_name = Column(String(255), nullable=False, comment="功能名称")
|
function_name = Column(String(255), nullable=False, comment="功能名称")
|
||||||
description = Column(String(1000), nullable=True, comment="描述")
|
description = Column(String(1000), nullable=True, comment="描述")
|
||||||
|
path = Column(String(500), nullable=True, comment="路径")
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""将模型实例转换为字典"""
|
"""将模型实例转换为字典"""
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ class FunctionListBase(BaseModel):
|
|||||||
"""功能基础模型"""
|
"""功能基础模型"""
|
||||||
function_name: str
|
function_name: str
|
||||||
description: Optional[str] = None
|
description: Optional[str] = None
|
||||||
|
path: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
class FunctionListCreate(FunctionListBase):
|
class FunctionListCreate(FunctionListBase):
|
||||||
@@ -17,6 +18,7 @@ class FunctionListUpdate(BaseModel):
|
|||||||
"""更新功能请求"""
|
"""更新功能请求"""
|
||||||
function_name: Optional[str] = None
|
function_name: Optional[str] = None
|
||||||
description: Optional[str] = None
|
description: Optional[str] = None
|
||||||
|
path: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
class FunctionListResponse(FunctionListBase):
|
class FunctionListResponse(FunctionListBase):
|
||||||
@@ -31,7 +33,8 @@ class FunctionListResponse(FunctionListBase):
|
|||||||
return cls(
|
return cls(
|
||||||
id=func.id,
|
id=func.id,
|
||||||
function_name=func.function_name,
|
function_name=func.function_name,
|
||||||
description=func.description
|
description=func.description,
|
||||||
|
path=func.path
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user