Sprint 1-3 Completed (Backend + Frontend): Backend (Sprint 1-2): - Implement 5-layer Agent framework (Query->Planner->Executor->Tools->Reflection) - Create agent_schema with 6 tables (agent_definitions, stages, prompts, sessions, traces, reflexion_rules) - Create protocol_schema with 2 tables (protocol_contexts, protocol_generations) - Implement Protocol Agent core services (Orchestrator, ContextService, PromptBuilder) - Integrate LLM service adapter (DeepSeek/Qwen/GPT-5/Claude) - 6 API endpoints with full authentication - 10/10 API tests passed Frontend (Sprint 3): - Add Protocol Agent entry in AgentHub (indigo theme card) - Implement ProtocolAgentPage with 3-column layout - Collapsible sidebar (Gemini style, 48px <-> 280px) - StatePanel with 5 stage cards (scientific_question, pico, study_design, sample_size, endpoints) - ChatArea with sync button and action cards integration - 100% prototype design restoration (608 lines CSS) - Detailed endpoints structure: baseline, exposure, outcomes, confounders Features: - 5-stage dialogue flow for research protocol design - Conversation-driven interaction with sync-to-protocol button - Real-time context state management - One-click protocol generation button (UI ready, backend pending) Database: - agent_schema: 6 tables for reusable Agent framework - protocol_schema: 2 tables for Protocol Agent - Seed data: 1 agent + 5 stages + 9 prompts + 4 reflexion rules Code Stats: - Backend: 13 files, 4338 lines - Frontend: 14 files, 2071 lines - Total: 27 files, 6409 lines Status: MVP core functionality completed, pending frontend-backend integration testing Next: Sprint 4 - One-click protocol generation + Word export
169 lines
4.0 KiB
Markdown
169 lines
4.0 KiB
Markdown
# OSS 账号与配置信息
|
||
|
||
> **创建日期:** 2026-01-22
|
||
> **状态:** 已配置
|
||
> **⚠️ 安全提醒:** 本文档不包含敏感密钥,AccessKey Secret 请从安全渠道获取
|
||
|
||
---
|
||
|
||
## 1. RAM 服务账号
|
||
|
||
| 配置项 | 值 |
|
||
|--------|-----|
|
||
| **显示名称** | AI临床研究OSS服务账号 |
|
||
| **登录名称** | `aiclinical-oss@1991407246109125.onaliyun.com` |
|
||
| **AccessKey ID** | `LTAI5tBHkL39GjdLfcr77Y3f` |
|
||
| **AccessKey Secret** | `********` (见 .env 文件或联系管理员) |
|
||
| **安全手机** | 86-18611348738 |
|
||
| **安全邮箱** | gofeng117@163.com |
|
||
| **授权策略** | AliyunOSSFullAccess |
|
||
|
||
---
|
||
|
||
## 2. Bucket 配置清单
|
||
|
||
### 2.1 生产环境
|
||
|
||
| Bucket 名称 | 区域 | ACL | 加密 | 用途 |
|
||
|-------------|------|-----|------|------|
|
||
| `ai-clinical-data` | 华北2(北京) | 私有 | SSE-OSS (AES256) | 核心数据(文献、病历、报告) |
|
||
| `ai-clinical-static` | 华北2(北京) | 公共读 | 无 | 静态资源(头像、Logo、RAG图片) |
|
||
|
||
### 2.2 开发环境
|
||
|
||
| Bucket 名称 | 区域 | ACL | 加密 | 用途 |
|
||
|-------------|------|-----|------|------|
|
||
| `ai-clinical-data-dev` | 华北2(北京) | 私有 | 无 | 开发测试核心数据 |
|
||
| `ai-clinical-static-dev` | 华北2(北京) | 公共读 | 无 | 开发测试静态资源 |
|
||
|
||
---
|
||
|
||
## 3. CORS 配置(所有 Bucket 相同)
|
||
|
||
| 配置项 | 值 |
|
||
|--------|-----|
|
||
| 来源 (AllowedOrigin) | `*` |
|
||
| 允许 Methods | GET, HEAD |
|
||
| 允许 Headers | `*` |
|
||
| 暴露 Headers | `ETag, x-oss-request-id` |
|
||
| 缓存时间 | 3600 秒 |
|
||
|
||
---
|
||
|
||
## 4. 生命周期规则
|
||
|
||
### 仅 Data Bucket 配置
|
||
|
||
| Bucket | 规则名称 | 前缀 | 策略 |
|
||
|--------|---------|------|------|
|
||
| `ai-clinical-data` | auto-delete-temp | `temp/` | 1 天后删除 |
|
||
| `ai-clinical-data-dev` | auto-delete-temp | `temp/` | 1 天后删除 |
|
||
|
||
---
|
||
|
||
## 5. 环境变量配置
|
||
|
||
### 5.1 本地开发环境 (`.env.development`)
|
||
|
||
```bash
|
||
# 存储类型
|
||
STORAGE_TYPE=oss
|
||
|
||
# OSS 开发环境配置
|
||
OSS_REGION=oss-cn-beijing
|
||
OSS_BUCKET=ai-clinical-data-dev
|
||
OSS_BUCKET_STATIC=ai-clinical-static-dev
|
||
OSS_ACCESS_KEY_ID=LTAI5tBHkL39GjdLfcr77Y3f
|
||
OSS_ACCESS_KEY_SECRET=<从安全渠道获取>
|
||
OSS_INTERNAL=false
|
||
```
|
||
|
||
### 5.2 SAE 生产环境
|
||
|
||
```bash
|
||
# 存储类型
|
||
STORAGE_TYPE=oss
|
||
|
||
# OSS 生产环境配置
|
||
OSS_REGION=oss-cn-beijing
|
||
OSS_BUCKET=ai-clinical-data
|
||
OSS_BUCKET_STATIC=ai-clinical-static
|
||
OSS_ACCESS_KEY_ID=LTAI5tBHkL39GjdLfcr77Y3f
|
||
OSS_ACCESS_KEY_SECRET=<从安全渠道获取>
|
||
OSS_INTERNAL=true # 🔴 生产必须用内网
|
||
```
|
||
|
||
---
|
||
|
||
## 6. Endpoint 地址
|
||
|
||
| 环境 | Endpoint | 说明 |
|
||
|------|----------|------|
|
||
| 公网(本地开发) | `oss-cn-beijing.aliyuncs.com` | 本地开发使用 |
|
||
| 内网(SAE 生产) | `oss-cn-beijing-internal.aliyuncs.com` | 生产环境必须使用,免流量费 |
|
||
|
||
---
|
||
|
||
## 7. 成本预警设置
|
||
|
||
| 配置项 | 值 |
|
||
|--------|-----|
|
||
| 预算名称 | OSS成本监控 |
|
||
| 月预算 | 100 元 |
|
||
| 告警阈值 | 80%, 100% |
|
||
| 通知方式 | 短信 + 邮件 |
|
||
| 通知手机 | 18611348738 |
|
||
| 通知邮箱 | gofeng117@163.com |
|
||
|
||
---
|
||
|
||
## 8. 安全注意事项
|
||
|
||
### 🔴 绝对不要做的事
|
||
|
||
1. **不要**将 AccessKey Secret 提交到 Git 仓库
|
||
2. **不要**在前端代码中使用 AccessKey
|
||
3. **不要**将 `ai-clinical-data` Bucket 设为公共读
|
||
4. **不要**在生产环境使用公网 Endpoint
|
||
|
||
### ✅ 应该做的事
|
||
|
||
1. AccessKey Secret 存储在 `.env` 文件(已加入 .gitignore)
|
||
2. 定期轮换 AccessKey(建议每 90 天)
|
||
3. 监控成本告警邮件
|
||
4. 生产环境使用内网 Endpoint
|
||
|
||
---
|
||
|
||
## 9. 快速参考
|
||
|
||
### 开发环境快速测试
|
||
|
||
```bash
|
||
# 1. 配置环境变量
|
||
export OSS_REGION=oss-cn-beijing
|
||
export OSS_BUCKET=ai-clinical-data-dev
|
||
export OSS_ACCESS_KEY_ID=LTAI5tBHkL39GjdLfcr77Y3f
|
||
export OSS_ACCESS_KEY_SECRET=<你的密钥>
|
||
export OSS_INTERNAL=false
|
||
|
||
# 2. 启动后端
|
||
cd backend
|
||
npm run dev
|
||
```
|
||
|
||
### 阿里云控制台链接
|
||
|
||
- [OSS 控制台](https://oss.console.aliyun.com/)
|
||
- [RAM 控制台](https://ram.console.aliyun.com/)
|
||
- [费用中心](https://usercenter2.aliyun.com/)
|
||
|
||
---
|
||
|
||
*文档结束。如有问题请联系:gofeng117@163.com*
|
||
|
||
|
||
|
||
|
||
|