feat(server): 新增云端缓存与同步服务端骨架

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Developer
2026-03-18 00:27:04 +08:00
parent df12a6ac72
commit 6764f4c53b
14 changed files with 2183 additions and 0 deletions

27
server/README.md Normal file
View File

@@ -0,0 +1,27 @@
# Magnet Cloud Cache Server
共享缓存池后端最小骨架:
- Fastify 4
- MySQL 5.7+/8.0+
- AES-256-GCM 数据库存储加密
- 共享线程缓存 / 范围缓存 / 页缓存
- 为未来账号体系和私有保险箱预留表结构
## 快速启动
1. 复制 `.env.example``.env`
2. 填好 MySQL 和加密密钥
3. 安装依赖:`npm install`
4. 启动:`npm start`
## 已实现接口
- `GET /health`
- `GET /ready`
- `POST /api/shared-cache/threads/lookup`
- `POST /api/shared-cache/threads/upsert`
- `POST /api/shared-cache/coverages/lookup`
- `POST /api/shared-cache/coverages/upsert`
- `POST /api/shared-cache/pages/lookup`
- `POST /api/shared-cache/pages/upsert`