Files
iqudo-top1/README.md
2026-08-19 22:48:23 +08:00

69 lines
2.1 KiB
Markdown
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.

# iqudo-top1
场景化销售话术与 SOP 平台。
## 本地运行
```bash
mysql -uroot -p < scripts/create-databases.sql
make web-install
make build
./bin/iqudo-top1
```
`make build` 默认使用当前 Go 环境的操作系统和架构,也可以显式指定目标架构:
```bash
make build ARCH=amd64
make build ARCH=arm64
```
如需交叉编译其他操作系统,可同时设置 `GOOS`,例如 `make build GOOS=linux ARCH=arm64`
构建时可以指定随产物携带的环境文件。基础配置和该文件会复制到 `bin/configs/`
```bash
make build ENV_FILE=config.test.yml
make build ENV_FILE=config.prod.yml ARCH=arm64
```
使用构建产物启动指定环境时,环境变量仍会覆盖文件中的配置:
```bash
./bin/main -config-dir bin/configs -env prod
```
默认配置位于 `configs/config.yml`,可以通过环境变量覆盖。
## Docker Compose 运行
Compose 会启动 MySQL、应用服务和 Nginx默认通过 `18090` 端口访问:
```bash
cp .env.example .env
# 修改 .env 中的数据库密码、JWT 密钥和初始管理员密码
make docker-config
make docker-up
```
查看服务日志使用 `make docker-logs`,停止服务使用 `make docker-down`。MySQL 数据保存在 `mysql-data` 命名卷中,停止服务不会删除数据。
镜像构建默认使用 `.env` 中的 `GOPROXY`。当前模板使用适合国内网络的代理;其他网络环境可以改为 `https://proxy.golang.org,direct`
## 宠物医生问诊问药示范场景
数据库结构由 GORM 在应用启动时自动同步,管理员初始化完成后执行:
```bash
make seed-pet-doctor
```
该命令会幂等地创建或完善以下配置:
- 宠物医生问诊问药场景
- 53 个场景输入字段,覆盖订单、商品图片、商品症状标签、客户、宠物、主诉、生命状态、既往史和用药详情
- 线上问诊边界、急症红旗、用药安全、观察与复诊 4 个场景知识实体
- 包含宠物信息收集、症状与疾病确认、方案与商品推荐的可用 SOP
示范场景是配置数据,通用流程引擎不包含宠物行业专用判断。