feat(ai): 补全 Prompt CRUD + 分析历史 + 用量统计 handler 和路由
- 替换 list_analysis/get_analysis 空壳为真实查询 - 新增 list_prompts/create_prompt/activate_prompt/rollback_prompt - 新增 usage_overview/usage_by_type - 注册 6 个新路由到 AiModule
This commit is contained in:
@@ -104,5 +104,29 @@ impl AiModule {
|
||||
"/ai/analysis/{id}",
|
||||
axum::routing::get(crate::handler::get_analysis),
|
||||
)
|
||||
.route(
|
||||
"/ai/prompts",
|
||||
axum::routing::get(crate::handler::list_prompts),
|
||||
)
|
||||
.route(
|
||||
"/ai/prompts",
|
||||
axum::routing::post(crate::handler::create_prompt),
|
||||
)
|
||||
.route(
|
||||
"/ai/prompts/{id}/activate",
|
||||
axum::routing::post(crate::handler::activate_prompt),
|
||||
)
|
||||
.route(
|
||||
"/ai/prompts/{id}/rollback",
|
||||
axum::routing::post(crate::handler::rollback_prompt),
|
||||
)
|
||||
.route(
|
||||
"/ai/usage/overview",
|
||||
axum::routing::get(crate::handler::usage_overview),
|
||||
)
|
||||
.route(
|
||||
"/ai/usage/by-type",
|
||||
axum::routing::get(crate::handler::usage_by_type),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user