feat: 部门管理添加按钮级权限控制,移除部门角色表

This commit is contained in:
2025-02-22 04:22:58 +08:00
parent 0c97feade2
commit a804732d53
6 changed files with 90 additions and 368 deletions

View File

@@ -86,13 +86,6 @@ class AddDepartmentParams(BaseModel):
}
class DeleteDepartmentListParams(BaseModel):
"""
删除部门参数模型。
"""
ids: List[str] = Field(..., description="部门ID列表")
class GetDepartmentListResult(ListQueryResult):
"""
获取部门列表结果模型。
@@ -105,74 +98,3 @@ class GetDepartmentListResponse(BaseResponse):
获取部门列表响应模型。
"""
data: GetDepartmentListResult = Field(default=None, description="响应数据")
class AddDepartmentRoleParams(BaseModel):
"""
添加部门角色参数模型。
"""
department_id: str = Field(..., max_length=36, description="部门ID")
role_id: str = Field(..., max_length=36, description="角色ID")
class Config:
json_schema_extra = {
"example": {
"department_id": "550e8400-e29b-41d4-a716-446655440000",
"role_id": "550e8400-e29b-41d4-a716-446655440000"
}
}
class DepartmentRoleInfo(BaseModel):
"""
部门角色信息模型。
"""
id: str = Field(..., max_length=36, description="主键ID")
department_id: str = Field(..., max_length=36, description="部门ID")
department_name: str = Field(..., max_length=100, description="部门名称")
department_phone: str = Field(..., max_length=30, description="部门电话")
department_principal: str = Field(..., max_length=64, description="部门负责人")
department_email: str = Field(..., max_length=128, description="部门邮箱")
role_name: str = Field(..., max_length=100, description="角色名称")
role_code: str = Field(..., max_length=100, description="角色编码")
role_id: str = Field(..., max_length=36, description="角色ID")
create_time: datetime = Field(..., description="创建时间")
update_time: datetime = Field(..., description="更新时间")
class Config:
json_schema_extra = {
"example": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"department_id": "550e8400-e29b-41d4-a716-446655440000",
"department_name": "研发部",
"department_phone": "1234567890",
"department_principal": "张三",
"department_email": "dev@example.com",
"role_name": "管理员",
"role_code": "admin",
"role_id": "550e8400-e29b-41d4-a716-446655440000",
"create_time": "2023-10-01T12:00:00",
"update_time": "2023-10-01T12:00:00"
}
}
class GetDepartmentRoleInfoResponse(BaseResponse):
"""
获取部门角色信息响应模型。
"""
data: DepartmentRoleInfo = Field(default=None, description="响应数据")
class GetDepartmentRoleListResult(ListQueryResult):
"""
获取部门角色列表结果模型。
"""
result: List[DepartmentRoleInfo] = Field(default=[], description="部门角色列表")
class GetDepartmentRoleListResponse(BaseResponse):
"""
获取部门角色列表响应模型。
"""
data: GetDepartmentRoleListResult = Field(default=None, description="响应数据")