Files
momentry_core/docs_v1.0/M4_workspace
Accusys efd6f4372e feat: integrate rust_register and rust_unregister into API
新增功能:
- API 支持 sync/async 模式切換
- 同步模式直接調用 rust_register / rust_unregister
- 異步模式通過 Worker 執行

修改:
1. UnregisterRequest 添加 async_mode 參數
2. RegisterFileRequest 添加 async_mode 參數
3. unregister() 函數支持雙模式
4. register_file() 函數支持雙模式

API 使用:
```bash
# 同步模式
POST /api/v1/unregister
{"file_uuid": "...", "async_mode": false}

POST /api/v1/files/register
{"file_path": "...", "async_mode": false}

# 異步模式
POST /api/v1/unregister
{"file_uuid": "...", "async_mode": true}

POST /api/v1/files/register
{"file_path": "...", "async_mode": true}
```

測試結果:
- ✅ Unregister 同步模式: 通過
- ✅ Unregister 異步模式: 通過
- ✅ Register 同步模式: 通過
- ✅ Register 異步模式: 通過

性能:
- 同步 Register: ~1s
- 同步 Unregister: ~2s
- 異步模式: 立即返回

優勢:
- 開發測試: 同步模式快速反饋
- 生產環境: 異步模式不阻塞

文檔:
- docs_v1.0/M4_workspace/2026-09-28_api_rust_integration_test.md

狀態: ✅ 測試通過,生產就緒
2026-09-28 19:41:40 +08:00
..