Files
zclaw_openfang/crates/zclaw-saas/src/industry/mod.rs
iven 5d1050bf6f
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
feat(industry): Phase 1 行业配置基础 — 数据模型 + 四行业内置配置 + ButlerRouter 动态关键词
- 新增 SaaS industry 模块 (types/service/handlers/mod/builtin)
- 4 行业内置配置: healthcare/education/garment/ecommerce
- 数据库迁移: industries + account_industries 表
- 8 个 API 端点 (CRUD + 用户行业关联)
- ButlerRouter 改造: 支持 IndustryKeywordConfig 动态注入
- 12 个测试全通过 (含动态行业分类测试)
2026-04-12 15:42:35 +08:00

26 lines
1.1 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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