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 个测试全通过 (含动态行业分类测试)
129 lines
6.7 KiB
Rust
129 lines
6.7 KiB
Rust
//! 四行业内置配置
|
||
//!
|
||
//! 作为数据库 seed,首次启动时通过 migration 自动插入 `source = "builtin"`。
|
||
|
||
/// 内置行业配置定义
|
||
pub struct BuiltinIndustryDef {
|
||
pub id: &'static str,
|
||
pub name: &'static str,
|
||
pub icon: &'static str,
|
||
pub description: &'static str,
|
||
pub keywords: &'static [&'static str],
|
||
pub system_prompt: &'static str,
|
||
pub cold_start_template: &'static str,
|
||
pub pain_seed_categories: &'static [&'static str],
|
||
pub skill_priorities: &'static [(&'static str, i32)],
|
||
}
|
||
|
||
/// 获取所有内置行业配置
|
||
pub fn builtin_industries() -> Vec<BuiltinIndustryDef> {
|
||
vec![
|
||
BuiltinIndustryDef {
|
||
id: "healthcare",
|
||
name: "医疗行政",
|
||
icon: "🏥",
|
||
description: "医院行政管理、科室排班、医保、病历管理",
|
||
keywords: &[
|
||
"医院", "科室", "排班", "护理", "门诊", "住院", "病历", "医嘱",
|
||
"药品", "处方", "检查", "手术", "出院", "入院", "急诊", "住院部",
|
||
"报告", "会诊", "转科", "转院", "床位数", "占用率",
|
||
"医疗", "患者", "医保", "挂号", "收费", "报销", "临床",
|
||
"值班", "交接班", "查房", "医技", "检验", "影像",
|
||
"院感", "质控", "病案", "门诊量", "手术量", "药占比",
|
||
],
|
||
system_prompt: "您是一位医疗行政管理助手。请注意使用医疗行业术语,回答要专业准确。涉及患者隐私的信息要严格保密。在提供数据报告时优先使用表格形式。",
|
||
cold_start_template: "您好!我是您的医疗行政管家。我可以帮您处理排班管理、数据报表、政策查询、会议协调等工作。有什么需要我帮忙的吗?",
|
||
pain_seed_categories: &[
|
||
"排班冲突", "数据报表耗时", "医保政策频繁变化",
|
||
"病历质控", "科室协调", "库存管理", "院感防控",
|
||
],
|
||
skill_priorities: &[
|
||
("data_report", 10),
|
||
("meeting_notes", 9),
|
||
("schedule_query", 8),
|
||
("policy_search", 7),
|
||
],
|
||
},
|
||
BuiltinIndustryDef {
|
||
id: "education",
|
||
name: "教育培训",
|
||
icon: "🎓",
|
||
description: "课程管理、学生评估、教务、培训",
|
||
keywords: &[
|
||
"课程", "学生", "评估", "教务", "培训", "教学", "考试",
|
||
"成绩", "班级", "学期", "教学计划", "教案", "课件",
|
||
"作业", "答疑", "辅导", "招生", "毕业", "学分",
|
||
"教师", "讲师", "课堂", "实验", "实习", "论文",
|
||
"学籍", "选课", "排课", "成绩单", "GPA", "教研",
|
||
"德育", "校务", "家校", "班主任",
|
||
],
|
||
system_prompt: "您是一位教育培训管理助手。熟悉教务流程、课程设计和学生评估方法。回答要注重教学法和学习效果。",
|
||
cold_start_template: "您好!我是您的教育培训助手。我可以帮您处理课程安排、成绩分析、教学计划、培训方案等工作。有什么需要我帮忙的吗?",
|
||
pain_seed_categories: &[
|
||
"排课冲突", "成绩统计繁琐", "教学资源不足",
|
||
"学生差异化管理", "家校沟通", "培训效果评估",
|
||
],
|
||
skill_priorities: &[
|
||
("data_report", 10),
|
||
("schedule_query", 9),
|
||
("content_writing", 8),
|
||
("meeting_notes", 7),
|
||
],
|
||
},
|
||
BuiltinIndustryDef {
|
||
id: "garment",
|
||
name: "制衣制造",
|
||
icon: "🏭",
|
||
description: "面料管理、打版、裁床、供应链",
|
||
keywords: &[
|
||
"面料", "打版", "裁床", "缝纫", "供应链", "订单", "样衣",
|
||
"尺码", "工艺", "质检", "包装", "出货", "库存",
|
||
"布料", "纱线", "织造", "染整", "印花", "绣花",
|
||
"辅料", "拉链", "纽扣", "里布", "衬布",
|
||
"生产线", "产能", "工时", "成本", "报价",
|
||
"采购", "交期", "验收", "返工", "损耗率", "排料",
|
||
],
|
||
system_prompt: "您是一位制衣制造管理助手。熟悉面料特性、生产流程和供应链管理。回答要务实,注重成本和效率。",
|
||
cold_start_template: "您好!我是您的制衣制造管家。我可以帮您处理订单跟踪、面料管理、生产排期、成本核算等工作。有什么需要我帮忙的吗?",
|
||
pain_seed_categories: &[
|
||
"交期延误", "面料损耗", "尺码管理",
|
||
"产能不足", "质检不合格", "成本超支", "供应链中断",
|
||
],
|
||
skill_priorities: &[
|
||
("data_report", 10),
|
||
("schedule_query", 9),
|
||
("inventory_mgmt", 8),
|
||
("order_tracking", 7),
|
||
],
|
||
},
|
||
BuiltinIndustryDef {
|
||
id: "ecommerce",
|
||
name: "电商零售",
|
||
icon: "🛒",
|
||
description: "库存管理、促销、客服、物流、品类运营",
|
||
keywords: &[
|
||
"库存", "促销", "客服", "物流", "品类", "订单", "发货",
|
||
"退货", "评价", "店铺", "商品", "SKU", "SPU",
|
||
"转化率", "客单价", "复购率", "GMV", "流量", "点击率",
|
||
"直通车", "钻展", "直播", "短视频", "种草", "达人",
|
||
"仓储", "拣货", "打包", "快递", "配送", "签收",
|
||
"售后", "退款", "换货", "投诉", "差评",
|
||
"选品", "定价", "毛利", "成本", "竞品",
|
||
"玩具", "食品", "服装", "美妆", "家居",
|
||
],
|
||
system_prompt: "您是一位电商零售管理助手。熟悉平台运营、库存管理、物流配送和客户服务。回答要注重数据驱动和ROI。",
|
||
cold_start_template: "您好!我是您的电商零售管家。我可以帮您处理库存预警、销售分析、促销方案、物流跟踪等工作。有什么需要我帮忙的吗?",
|
||
pain_seed_categories: &[
|
||
"库存积压", "转化率低", "退货率高",
|
||
"物流延迟", "客服压力大", "选品困难", "价格战",
|
||
],
|
||
skill_priorities: &[
|
||
("data_report", 10),
|
||
("inventory_mgmt", 9),
|
||
("order_tracking", 8),
|
||
("content_writing", 7),
|
||
],
|
||
},
|
||
]
|
||
}
|