Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- 新增 SaaS industry 模块 (types/service/handlers/mod/builtin) - 4 行业内置配置: healthcare/education/garment/ecommerce - 数据库迁移: industries + account_industries 表 - 8 个 API 端点 (CRUD + 用户行业关联) - ButlerRouter 改造: 支持 IndustryKeywordConfig 动态注入 - 12 个测试全通过 (含动态行业分类测试)
26 lines
1.1 KiB
Rust
26 lines
1.1 KiB
Rust
//! 行业配置模块
|
||
//!
|
||
//! 提供行业定义、关键词、system prompt、痛点种子等配置管理。
|
||
//! 支持内置行业(builtin)和 Admin 自定义行业。
|
||
|
||
pub mod types;
|
||
pub mod builtin;
|
||
pub mod service;
|
||
pub mod handlers;
|
||
|
||
use axum::routing::{get, patch, post, put};
|
||
|
||
pub fn routes() -> axum::Router<crate::state::AppState> {
|
||
axum::Router::new()
|
||
// 公开路由(已认证用户)
|
||
.route("/api/v1/industries", get(handlers::list_industries))
|
||
.route("/api/v1/industries/:id", get(handlers::get_industry))
|
||
.route("/api/v1/industries/:id/full-config", get(handlers::get_industry_full_config))
|
||
.route("/api/v1/accounts/me/industries", get(handlers::list_my_industries))
|
||
.route("/api/v1/accounts/:id/industries", get(handlers::list_account_industries))
|
||
// Admin 路由
|
||
.route("/api/v1/industries", post(handlers::create_industry))
|
||
.route("/api/v1/industries/:id", patch(handlers::update_industry))
|
||
.route("/api/v1/accounts/:id/industries", put(handlers::set_account_industries))
|
||
}
|