feat(industry): Phase 1 行业配置基础 — 数据模型 + 四行业内置配置 + ButlerRouter 动态关键词
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 个测试全通过 (含动态行业分类测试)
This commit is contained in:
iven
2026-04-12 15:42:35 +08:00
parent 5599cefc41
commit 5d1050bf6f
13 changed files with 886 additions and 32 deletions

View File

@@ -0,0 +1,25 @@
//! 行业配置模块
//!
//! 提供行业定义、关键词、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))
}