mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-23 21:18:09 +00:00
style: 移除Python文件中的编码声明并优化代码格式
refactor: 重构前端组件和样式,添加AI助手功能 docs: 更新README文档,添加ruff代码检查说明 feat: 新增AI助手相关API和前端组件 chore: 更新.gitignore文件,添加ruff缓存配置 fix: 修复前端布局和设置相关的问题 perf: 优化代码结构和性能,移除冗余代码 test: 更新测试文件,移除编码声明 build: 更新依赖版本,调整requirements.txt
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import APIRouter, Body, Depends, Path
|
||||
from fastapi.responses import JSONResponse, StreamingResponse
|
||||
from redis.asyncio.client import Redis
|
||||
|
||||
from app.common.response import StreamResponse, SuccessResponse
|
||||
from app.api.v1.module_system.auth.schema import AuthSchema
|
||||
from app.common.request import PaginationService
|
||||
from app.common.response import StreamResponse, SuccessResponse
|
||||
from app.core.base_params import PaginationQueryParam
|
||||
from app.core.base_schema import BatchSetAvailable
|
||||
from app.core.dependencies import AuthPermission, redis_getter
|
||||
@@ -13,24 +14,23 @@ from app.core.logger import log
|
||||
from app.core.router_class import OperationLogRoute
|
||||
from app.utils.common_util import bytes2file_response
|
||||
|
||||
from ..auth.schema import AuthSchema
|
||||
from .service import DictTypeService, DictDataService
|
||||
from .schema import (
|
||||
DictTypeCreateSchema,
|
||||
DictTypeUpdateSchema,
|
||||
DictDataCreateSchema,
|
||||
DictDataQueryParam,
|
||||
DictDataUpdateSchema,
|
||||
DictDataQueryParam,
|
||||
DictTypeQueryParam
|
||||
DictTypeCreateSchema,
|
||||
DictTypeQueryParam,
|
||||
DictTypeUpdateSchema,
|
||||
)
|
||||
|
||||
from .service import DictDataService, DictTypeService
|
||||
|
||||
DictRouter = APIRouter(route_class=OperationLogRoute, prefix="/dict", tags=["字典管理"])
|
||||
|
||||
|
||||
@DictRouter.get("/type/detail/{id}", summary="获取字典类型详情", description="获取字典类型详情")
|
||||
async def get_type_detail_controller(
|
||||
id: int = Path(..., description="字典类型ID", ge=1),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:detail"]))
|
||||
id: Annotated[int, Path(description="字典类型ID", ge=1)],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_type:detail"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
获取字典类型详情
|
||||
@@ -38,10 +38,10 @@ async def get_type_detail_controller(
|
||||
参数:
|
||||
- id (int): 字典类型ID
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含字典类型详情的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 获取字典类型详情失败时抛出异常。
|
||||
"""
|
||||
@@ -49,11 +49,12 @@ async def get_type_detail_controller(
|
||||
log.info(f"获取字典类型详情成功 {id}")
|
||||
return SuccessResponse(data=result_dict, msg="获取字典类型详情成功")
|
||||
|
||||
|
||||
@DictRouter.get("/type/list", summary="查询字典类型", description="查询字典类型")
|
||||
async def get_type_list_controller(
|
||||
page: PaginationQueryParam = Depends(),
|
||||
search: DictTypeQueryParam = Depends(),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:query"]))
|
||||
page: Annotated[PaginationQueryParam, Depends()],
|
||||
search: Annotated[DictTypeQueryParam, Depends()],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_type:query"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
查询字典类型
|
||||
@@ -62,43 +63,45 @@ async def get_type_list_controller(
|
||||
- page (PaginationQueryParam): 分页参数模型
|
||||
- search (DictTypeQueryParam): 查询参数模型
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含查询字典类型结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 查询字典类型失败时抛出异常。
|
||||
"""
|
||||
result_dict_list = await DictTypeService.get_obj_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)
|
||||
log.info(f"查询字典类型列表成功")
|
||||
result_dict = await PaginationService.paginate(data_list=result_dict_list, page_no=page.page_no, page_size=page.page_size)
|
||||
log.info("查询字典类型列表成功")
|
||||
return SuccessResponse(data=result_dict, msg="查询字典类型列表成功")
|
||||
|
||||
|
||||
@DictRouter.get("/type/optionselect", summary="获取全部字典类型", description="获取全部字典类型")
|
||||
async def get_type_loptionselect_controller(
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:query"]))
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_type:query"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
获取全部字典类型
|
||||
|
||||
参数:
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含全部字典类型的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 获取字典类型列表失败时抛出异常。
|
||||
"""
|
||||
result_dict_list = await DictTypeService.get_obj_list_service(auth=auth)
|
||||
log.info(f"获取字典类型列表成功")
|
||||
log.info("获取字典类型列表成功")
|
||||
return SuccessResponse(data=result_dict_list, msg="获取字典类型列表成功")
|
||||
|
||||
|
||||
@DictRouter.post("/type/create", summary="创建字典类型", description="创建字典类型")
|
||||
async def create_type_controller(
|
||||
data: DictTypeCreateSchema,
|
||||
redis: Redis = Depends(redis_getter),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:create"]))
|
||||
redis: Annotated[Redis, Depends(redis_getter)],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_type:create"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
创建字典类型
|
||||
@@ -107,10 +110,10 @@ async def create_type_controller(
|
||||
- data (DictTypeCreateSchema): 创建字典类型的入参模型
|
||||
- redis (Redis): Redis数据库连接
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含创建字典类型结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 创建字典类型失败时抛出异常。
|
||||
"""
|
||||
@@ -118,12 +121,13 @@ async def create_type_controller(
|
||||
log.info(f"创建字典类型成功: {result_dict}")
|
||||
return SuccessResponse(data=result_dict, msg="创建字典类型成功")
|
||||
|
||||
|
||||
@DictRouter.put("/type/update/{id}", summary="修改字典类型", description="修改字典类型")
|
||||
async def update_type_controller(
|
||||
data: DictTypeUpdateSchema,
|
||||
redis: Redis = Depends(redis_getter),
|
||||
id: int = Path(..., description="字典类型ID", ge=1),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:update"]))
|
||||
redis: Annotated[Redis, Depends(redis_getter)],
|
||||
id: Annotated[int, Path(description="字典类型ID", ge=1)],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_type:update"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
修改字典类型
|
||||
@@ -133,10 +137,10 @@ async def update_type_controller(
|
||||
- redis (Redis): Redis数据库连接
|
||||
- id (int): 字典类型ID
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含修改字典类型结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 修改字典类型失败时抛出异常。
|
||||
"""
|
||||
@@ -144,11 +148,12 @@ async def update_type_controller(
|
||||
log.info(f"修改字典类型成功: {result_dict}")
|
||||
return SuccessResponse(data=result_dict, msg="修改字典类型成功")
|
||||
|
||||
|
||||
@DictRouter.delete("/type/delete", summary="删除字典类型", description="删除字典类型")
|
||||
async def delete_type_controller(
|
||||
redis: Redis = Depends(redis_getter),
|
||||
ids: list[int] = Body(..., description="ID列表"),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:delete"]))
|
||||
redis: Annotated[Redis, Depends(redis_getter)],
|
||||
ids: Annotated[list[int], Body(description="ID列表")],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_type:delete"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
删除字典类型
|
||||
@@ -157,10 +162,10 @@ async def delete_type_controller(
|
||||
- redis (Redis): Redis数据库连接
|
||||
- ids (list[int]): 字典类型ID列表
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含删除字典类型结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 删除字典类型失败时抛出异常。
|
||||
"""
|
||||
@@ -168,10 +173,11 @@ async def delete_type_controller(
|
||||
log.info(f"删除字典类型成功: {ids}")
|
||||
return SuccessResponse(msg="删除字典类型成功")
|
||||
|
||||
|
||||
@DictRouter.patch("/type/available/setting", summary="批量修改字典类型状态", description="批量修改字典类型状态")
|
||||
async def batch_set_available_dict_type_controller(
|
||||
data: BatchSetAvailable,
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:patch"]))
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_type:patch"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
批量修改字典类型状态
|
||||
@@ -179,10 +185,10 @@ async def batch_set_available_dict_type_controller(
|
||||
参数:
|
||||
- data (BatchSetAvailable): 批量修改字典类型状态负载模型
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含批量修改字典类型状态结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 批量修改字典类型状态失败时抛出异常。
|
||||
"""
|
||||
@@ -190,10 +196,11 @@ async def batch_set_available_dict_type_controller(
|
||||
log.info(f"批量修改字典类型状态成功: {data.ids}")
|
||||
return SuccessResponse(msg="批量修改字典类型状态成功")
|
||||
|
||||
|
||||
@DictRouter.post('/type/export', summary="导出字典类型", description="导出字典类型")
|
||||
async def export_type_list_controller(
|
||||
search: DictTypeQueryParam = Depends(),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_type:export"]))
|
||||
search: Annotated[DictTypeQueryParam, Depends()],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_type:export"]))]
|
||||
) -> StreamingResponse:
|
||||
"""
|
||||
导出字典类型
|
||||
@@ -201,10 +208,10 @@ async def export_type_list_controller(
|
||||
参数:
|
||||
- search (DictTypeQueryParam): 查询参数模型
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- StreamingResponse: 包含导出字典类型结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 导出字典类型失败时抛出异常。
|
||||
"""
|
||||
@@ -216,15 +223,16 @@ async def export_type_list_controller(
|
||||
return StreamResponse(
|
||||
data=bytes2file_response(export_result),
|
||||
media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
headers = {
|
||||
headers={
|
||||
'Content-Disposition': 'attachment; filename=dict_type.xlsx'
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@DictRouter.get("/data/detail/{id}", summary="获取字典数据详情", description="获取字典数据详情")
|
||||
async def get_data_detail_controller(
|
||||
id: int = Path(..., description="字典数据ID", ge=1),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:detail"]))
|
||||
id: Annotated[int, Path(description="字典数据ID", ge=1)],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_data:detail"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
获取字典数据详情
|
||||
@@ -232,10 +240,10 @@ async def get_data_detail_controller(
|
||||
参数:
|
||||
- id (int): 字典数据ID
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含字典数据详情的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 获取字典数据详情失败时抛出异常。
|
||||
"""
|
||||
@@ -243,11 +251,12 @@ async def get_data_detail_controller(
|
||||
log.info(f"获取字典数据详情成功 {id}")
|
||||
return SuccessResponse(data=result_dict, msg="获取字典数据详情成功")
|
||||
|
||||
|
||||
@DictRouter.get("/data/list", summary="查询字典数据", description="查询字典数据")
|
||||
async def get_data_list_controller(
|
||||
page: PaginationQueryParam = Depends(),
|
||||
search: DictDataQueryParam = Depends(),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:query"]))
|
||||
page: Annotated[PaginationQueryParam, Depends()],
|
||||
search: Annotated[DictDataQueryParam, Depends()],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_data:query"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
查询字典数据
|
||||
@@ -256,10 +265,10 @@ async def get_data_list_controller(
|
||||
- page (PaginationQueryParam): 分页查询参数模型
|
||||
- search (DictDataQueryParam): 查询参数模型
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含字典数据列表的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 查询字典数据列表失败时抛出异常。
|
||||
"""
|
||||
@@ -267,15 +276,16 @@ async def get_data_list_controller(
|
||||
if page.order_by:
|
||||
order_by = page.order_by
|
||||
result_dict_list = await DictDataService.get_obj_list_service(auth=auth, search=search, order_by=order_by)
|
||||
result_dict = await PaginationService.paginate(data_list= result_dict_list, page_no= page.page_no, page_size = page.page_size)
|
||||
log.info(f"查询字典数据列表成功")
|
||||
result_dict = await PaginationService.paginate(data_list=result_dict_list, page_no=page.page_no, page_size=page.page_size)
|
||||
log.info("查询字典数据列表成功")
|
||||
return SuccessResponse(data=result_dict, msg="查询字典数据列表成功")
|
||||
|
||||
|
||||
@DictRouter.post("/data/create", summary="创建字典数据", description="创建字典数据")
|
||||
async def create_data_controller(
|
||||
data: DictDataCreateSchema,
|
||||
redis: Redis = Depends(redis_getter),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:create"]))
|
||||
redis: Annotated[Redis, Depends(redis_getter)],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_data:create"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
创建字典数据
|
||||
@@ -284,10 +294,10 @@ async def create_data_controller(
|
||||
- data (DictDataCreateSchema): 创建字典数据负载模型
|
||||
- redis (Redis): Redis数据库连接
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含创建字典数据结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 创建字典数据失败时抛出异常。
|
||||
"""
|
||||
@@ -295,12 +305,13 @@ async def create_data_controller(
|
||||
log.info(f"创建字典数据成功: {result_dict}")
|
||||
return SuccessResponse(data=result_dict, msg="创建字典数据成功")
|
||||
|
||||
|
||||
@DictRouter.put("/data/update/{id}", summary="修改字典数据", description="修改字典数据")
|
||||
async def update_data_controller(
|
||||
data: DictDataUpdateSchema,
|
||||
redis: Redis = Depends(redis_getter),
|
||||
id: int = Path(..., description="字典数据ID"),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:update"]))
|
||||
redis: Annotated[Redis, Depends(redis_getter)],
|
||||
id: Annotated[int, Path(description="字典数据ID")],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_data:update"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
修改字典数据
|
||||
@@ -310,10 +321,10 @@ async def update_data_controller(
|
||||
- redis (Redis): Redis数据库连接
|
||||
- id (int): 字典数据ID
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含修改字典数据结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 修改字典数据失败时抛出异常。
|
||||
"""
|
||||
@@ -321,11 +332,12 @@ async def update_data_controller(
|
||||
log.info(f"修改字典数据成功: {result_dict}")
|
||||
return SuccessResponse(data=result_dict, msg="修改字典数据成功")
|
||||
|
||||
|
||||
@DictRouter.delete("/data/delete", summary="删除字典数据", description="删除字典数据")
|
||||
async def delete_data_controller(
|
||||
redis: Redis = Depends(redis_getter),
|
||||
ids: list[int] = Body(..., description="ID列表"),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:delete"]))
|
||||
redis: Annotated[Redis, Depends(redis_getter)],
|
||||
ids: Annotated[list[int], Body(description="ID列表")],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_data:delete"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
删除字典数据
|
||||
@@ -334,10 +346,10 @@ async def delete_data_controller(
|
||||
- redis (Redis): Redis数据库连接
|
||||
- ids (list[int]): 字典数据ID列表
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含删除字典数据结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 删除字典数据失败时抛出异常。
|
||||
"""
|
||||
@@ -345,10 +357,11 @@ async def delete_data_controller(
|
||||
log.info(f"删除字典数据成功: {ids}")
|
||||
return SuccessResponse(msg="删除字典数据成功")
|
||||
|
||||
|
||||
@DictRouter.patch("/data/available/setting", summary="批量修改字典数据状态", description="批量修改字典数据状态")
|
||||
async def batch_set_available_dict_data_controller(
|
||||
data: BatchSetAvailable,
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:patch"]))
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_data:patch"]))]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
批量修改字典数据状态
|
||||
@@ -356,10 +369,10 @@ async def batch_set_available_dict_data_controller(
|
||||
参数:
|
||||
- data (BatchSetAvailable): 批量修改字典数据状态负载模型
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含批量修改字典数据状态结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 批量修改字典数据状态失败时抛出异常。
|
||||
"""
|
||||
@@ -367,11 +380,12 @@ async def batch_set_available_dict_data_controller(
|
||||
log.info(f"批量修改字典数据状态成功: {data.ids}")
|
||||
return SuccessResponse(msg="批量修改字典数据状态成功")
|
||||
|
||||
|
||||
@DictRouter.post('/data/export', summary="导出字典数据", description="导出字典数据")
|
||||
async def export_data_list_controller(
|
||||
search: DictDataQueryParam = Depends(),
|
||||
page: PaginationQueryParam = Depends(),
|
||||
auth: AuthSchema = Depends(AuthPermission(["module_system:dict_data:export"]))
|
||||
search: Annotated[DictDataQueryParam, Depends()],
|
||||
page: Annotated[PaginationQueryParam, Depends()],
|
||||
auth: Annotated[AuthSchema, Depends(AuthPermission(["module_system:dict_data:export"]))]
|
||||
) -> StreamingResponse:
|
||||
"""
|
||||
导出字典数据
|
||||
@@ -380,10 +394,10 @@ async def export_data_list_controller(
|
||||
- search (DictDataQueryParam): 查询参数模型
|
||||
- page (PaginationQueryParam): 分页参数模型
|
||||
- auth (AuthSchema): 认证信息模型
|
||||
|
||||
|
||||
返回:
|
||||
- StreamingResponse: 包含导出字典数据结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 导出字典数据失败时抛出异常。
|
||||
"""
|
||||
@@ -394,15 +408,16 @@ async def export_data_list_controller(
|
||||
return StreamResponse(
|
||||
data=bytes2file_response(export_result),
|
||||
media_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
headers = {
|
||||
headers={
|
||||
'Content-Disposition': 'attachment; filename=dice_data.xlsx'
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@DictRouter.get('/data/info/{dict_type}', summary="根据字典类型获取数据", description="根据字典类型获取数据")
|
||||
async def get_init_dict_data_controller(
|
||||
dict_type: str,
|
||||
redis: Redis = Depends(redis_getter)
|
||||
redis: Annotated[Redis, Depends(redis_getter)]
|
||||
) -> JSONResponse:
|
||||
"""
|
||||
根据字典类型获取数据
|
||||
@@ -410,10 +425,10 @@ async def get_init_dict_data_controller(
|
||||
参数:
|
||||
- dict_type (str): 字典类型
|
||||
- redis (Redis): Redis数据库连接
|
||||
|
||||
|
||||
返回:
|
||||
- JSONResponse: 包含根据字典类型获取数据结果的响应模型
|
||||
|
||||
|
||||
异常:
|
||||
- CustomException: 根据字典类型获取数据失败时抛出异常。
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user