ODF/README.md

52 lines
1.4 KiB
Markdown
Raw Normal View History

2026-05-14 08:04:47 +00:00
# ODF 光纤配线单元管理系统
2026-05-14 07:53:55 +00:00
2026-05-14 08:04:47 +00:00
本项目是一个 ODFOptical Distribution Frame光纤配线架配线单元管理系统的 Python 示例工程。使用 FastAPI 构建,采用内存假数据存储,无需外部基础设施。
## 功能特性
- 管理 ODF 机架Rack添加、查询、删除
- 管理配线单元Unit每个机架包含多个配线单元
- 管理光纤端口Port每个单元包含多个光纤端口
- 管理跳接连接Connection记录端口之间的跳纤关系
- 查询空闲端口、指定端口的连接路径
## 安装依赖
```bash
pip install -r requirements.txt
```
## 启动服务
```bash
cd codegen-runs/codegen_ff965d9f6029446ca6b6913dd1d7b45c
uvicorn app.main:app --reload --port 8000
```
启动后访问 API 文档:
- Swagger UIhttp://127.0.0.1:8000/docs
- ReDochttp://127.0.0.1:8000/redoc
## 运行测试
```bash
cd codegen-runs/codegen_ff965d9f6029446ca6b6913dd1d7b45c
python -m pytest tests/test_basic.py -v
```
## 工程结构
```
.
├── README.md
├── requirements.txt
├── app/
│ ├── __init__.py
│ ├── main.py # FastAPI 应用入口,路由定义
│ ├── models.py # 数据模型(内存存储结构)
│ ├── schemas.py # Pydantic 请求/响应模型
│ └── services.py # 业务逻辑层(内存假数据)
└── tests/
└── test_basic.py # 基础测试
```