DCTS/crates/server/README.md

38 lines
1.1 KiB
Markdown
Raw Permalink 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.

# server
> DCTS 中央调度与 REST API 服务端程序。
---
## 📦 模块概览
`server` 是基于 Axum 框架构建的高性能中央 Master 控制服务。
- **`main.rs`**HTTP Router 初始化、命令行参数解析 (`clap`) 与后台掉线检测 / 任务超时重入循环。
- **`db.rs`**:基于 SQLite + `r2d2` 的持久化数据层,管理网格点、节点及任务历史。
- **`scheduler.rs`**:网格点自动展开生成器与状态更新管道。
- **`api/`**
- `node.rs`:节点注册与心跳接口。
- `task.rs`:任务 Claim 抢占与 Report 结果汇报。
- `seed.rs``.7` 大气结构二进制种子下载。
- `data.rs`:二进制运行依赖与谱线库分发。
- `workflow.rs`:网格工作流 CRUD 与启动/停止控制。
- `status.rs`:系统运行全貌状态上报。
---
## 🚀 Setup & Testing
### 编译与启动
```bash
cargo build -p server --release
./target/release/server --workflow config.yaml --port 8080
```
### 自动化测试
```bash
cargo test -p server
```
详细 API 规范请参阅 [API Reference](../../docs/api_reference.md)。