refactor: 重构服务层方法命名规范

fix: 修复文件下载和删除功能
fix: 修复Redis哈希获取方法返回值类型
fix: 修复权限检查逻辑

perf: 优化部门和服务详情查询性能
perf: 优化角色数据范围显示

style: 清理无用导入和注释
style: 统一CRUD方法命名

docs: 更新main.py中的命令说明

chore: 移动IP定位工具类位置
chore: 更新.gitignore忽略迁移版本文件
This commit is contained in:
zhangtao
2025-10-03 03:31:45 +08:00
parent 7b9d8d7854
commit 119964e6f9
42 changed files with 326 additions and 545 deletions
@@ -26,7 +26,7 @@ async def get_obj_detail_controller(
id: int = Path(..., description="应用ID"),
auth: AuthSchema = Depends(AuthPermission(permissions=["application:myapp:query"]))
) -> JSONResponse:
result_dict = await ApplicationService.get_application_detail_service(id=id, auth=auth)
result_dict = await ApplicationService.detail_service(id=id, auth=auth)
logger.info(f"获取应用详情成功 {id}")
return SuccessResponse(data=result_dict, msg="获取应用详情成功")
@@ -36,7 +36,7 @@ async def get_obj_list_controller(
search: ApplicationQueryParam = Depends(),
auth: AuthSchema = Depends(AuthPermission(permissions=["application:myapp:query"]))
) -> JSONResponse:
result_dict_list = await ApplicationService.get_application_list_service(auth=auth, search=search, order_by=page.order_by)
result_dict_list = await ApplicationService.list_service(auth=auth, search=search, order_by=page.order_by)
result_dict = await PaginationService.paginate(data_list=result_dict_list, page_no=page.page_no, page_size=page.page_size)
logger.info(f"查询应用列表成功")
return SuccessResponse(data=result_dict, msg="查询应用列表成功")
@@ -46,7 +46,7 @@ async def create_obj_controller(
data: ApplicationCreateSchema,
auth: AuthSchema = Depends(AuthPermission(permissions=["application:myapp:create"]))
) -> JSONResponse:
result_dict = await ApplicationService.create_application_service(auth=auth, data=data)
result_dict = await ApplicationService.create_service(auth=auth, data=data)
logger.info(f"创建应用成功: {result_dict}")
return SuccessResponse(data=result_dict, msg="创建应用成功")
@@ -56,7 +56,7 @@ async def update_obj_controller(
id: int = Path(..., description="应用ID"),
auth: AuthSchema = Depends(AuthPermission(permissions=["application:myapp:update"]))
) -> JSONResponse:
result_dict = await ApplicationService.update_application_service(auth=auth, id=id, data=data)
result_dict = await ApplicationService.update_service(auth=auth, id=id, data=data)
logger.info(f"修改应用成功: {result_dict}")
return SuccessResponse(data=result_dict, msg="修改应用成功")
@@ -65,7 +65,7 @@ async def delete_obj_controller(
ids: list[int] = Body(..., description="ID列表"),
auth: AuthSchema = Depends(AuthPermission(permissions=["application:myapp:delete"]))
) -> JSONResponse:
await ApplicationService.delete_application_service(auth=auth, ids=ids)
await ApplicationService.delete_service(auth=auth, ids=ids)
logger.info(f"删除应用成功: {ids}")
return SuccessResponse(msg="删除应用成功")
@@ -74,6 +74,6 @@ async def batch_set_available_obj_controller(
data: BatchSetAvailable,
auth: AuthSchema = Depends(AuthPermission(permissions=["application:myapp:patch"]))
) -> JSONResponse:
await ApplicationService.set_application_available_service(auth=auth, data=data)
await ApplicationService.set_available_service(auth=auth, data=data)
logger.info(f"批量修改应用状态成功: {data.ids}")
return SuccessResponse(msg="批量修改应用状态成功")