Skip to content

Commit

Permalink
Fix casbin policy api return schema (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-clan authored Jan 24, 2025
1 parent ebe710f commit 20e873b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/app/admin/api/v1/sys/casbin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def get_pagination_casbin(
@router.get('/policies', summary='获取所有P权限策略', dependencies=[DependsJwtAuth])
async def get_all_policies(
role: Annotated[int | None, Query(description='角色ID')] = None,
) -> ResponseSchemaModel[list[GetPolicyDetail]]:
) -> ResponseSchemaModel[list[list[str]]]:
policies = await casbin_service.get_policy_list(role=role)
return response_base.success(data=policies)

Expand Down Expand Up @@ -155,7 +155,7 @@ async def delete_all_policies(sub: DeleteAllPoliciesParam) -> ResponseModel:


@router.get('/groups', summary='获取所有G权限策略', dependencies=[DependsJwtAuth])
async def get_all_groups() -> ResponseSchemaModel[list]:
async def get_all_groups() -> ResponseSchemaModel[list[list[str]]]:
data = await casbin_service.get_group_list()
return response_base.success(data=data)

Expand Down

0 comments on commit 20e873b

Please sign in to comment.