35 lines
1.8 KiB
Python
35 lines
1.8 KiB
Python
# +======================================================================
|
|
# | 模块: 配置项路由层
|
|
# | 说明: 提供配置项的增删改查、批量删除、状态管理等 API 接口
|
|
# +======================================================================
|
|
"""配置项相关路由。"""
|
|
|
|
# ----------------------------------------------------------------------
|
|
# 导入配置项模块的各类处理器(Handler)
|
|
# 涵盖:分页、详情、新增、更新、删除、批量删除、状态变更
|
|
# ----------------------------------------------------------------------
|
|
from modules.configuration.config_item.handlers import (ConfigItemAddHandler, ConfigItemDeleteHandler,
|
|
ConfigItemDetailHandler, ConfigItemPageHandler,
|
|
ConfigItemStatusHandler, ConfigItemUpdateHandler,
|
|
ConfigItemBatchDeleteHandler)
|
|
|
|
# ----------------------------------------------------------------------
|
|
# 路由表:每一项为 (URL 正则, 处理器类)
|
|
# ----------------------------------------------------------------------
|
|
routes = [
|
|
# 配置项分页查询
|
|
(r"/config/item/page", ConfigItemPageHandler),
|
|
# 查询配置项详情,路径参数为配置项 ID
|
|
(r"/config/item/detail/(\d+)", ConfigItemDetailHandler),
|
|
# 新增配置项
|
|
(r"/config/item/add", ConfigItemAddHandler),
|
|
# 更新配置项信息
|
|
(r"/config/item/update", ConfigItemUpdateHandler),
|
|
# 删除单个配置项,路径参数为配置项 ID
|
|
(r"/config/item/delete/(\d+)", ConfigItemDeleteHandler),
|
|
# 批量删除配置项
|
|
(r"/config/item/batchDelete", ConfigItemBatchDeleteHandler),
|
|
# 修改配置项状态(如启用 / 禁用)
|
|
(r"/config/item/status", ConfigItemStatusHandler),
|
|
]
|