AI调度服务,负责处理文档的AI任务调度和执行,包括文档转换、摘要生成、标签提取、向量化等功能。
ai-scheduler-api/ ├── src/main/java/cn/l8ai/backend/ │ ├── application/ # 应用层 │ │ ├── service/ # 业务服务 │ │ └── controller/ # REST控制器 │ ├── domain/ # 领域层 │ │ ├── entity/ # 实体类 │ │ └── repository/ # 仓储接口 │ ├── infrastructure/ # 基础设施层 │ │ ├── config/ # 配置类 │ │ └── client/ # 外部客户端 │ └── schedule/ # 定时任务 ├── src/main/resources/ │ ├── application.yml # 配置文件 │ └── mapper/ # MyBatis映射文件 ├── doc/ # 文档目录 │ ├── api/ # API文档 │ ├── sql/ # SQL脚本 │ └── schema/ # 数据结构 ├── build.sh # 构建脚本 ├── start.sh # 启动脚本 └── Dockerfile # Docker构建文件
mvn clean install
修改 src/main/resources/application.yml 中的配置:
# 方式1: Maven启动
mvn spring-boot:run
# 方式2: 脚本启动
./start.sh
# 方式3: Docker启动
docker build -t ai-scheduler-api .
docker run -p 8081:8081 ai-scheduler-api
server:
port: 8081
spring:
datasource:
url: jdbc:mysql://localhost:3306/zheyin
username: root
password: your_password
# Ollama配置
ollama:
base-url: http://localhost:11434
model: qwen2.5:7b
# 文件存储配置
file:
upload-path: /ai-file
temp-path: /tmp
服务启动后可访问Swagger文档:
系统包含以下定时任务:
# 构建镜像
docker build -t ai-scheduler-api .
# 运行容器
docker run -d \
--name ai-scheduler-api \
-p 8081:8081 \
-v /ai-file:/ai-file \
ai-scheduler-api