将 native/api/ 改名为 native/wndb/,避免与 Web API 层命名冲突
This commit is contained in:
@@ -84,7 +84,7 @@ async def get_reports(user: UserInDB = Depends(require_viewer)):
|
||||
## 4️⃣ Call Native (Binary) Code
|
||||
|
||||
```python
|
||||
from app.native.api import get_all_junctions, add_junction, set_junction
|
||||
from app.native.wndb import get_all_junctions, add_junction, set_junction
|
||||
|
||||
# Read network elements
|
||||
junctions = get_all_junctions()
|
||||
@@ -96,7 +96,7 @@ add_junction({"id": "J1", "x": 0.0, "y": 0.0, "demand": 100.0})
|
||||
set_junction("J1", {"demand": 150.0})
|
||||
|
||||
# Get constants
|
||||
from app.native.api import PIPE_STATUS_OPEN, OPTION_UNITS_LPS
|
||||
from app.native.wndb import PIPE_STATUS_OPEN, OPTION_UNITS_LPS
|
||||
```
|
||||
|
||||
---
|
||||
@@ -174,7 +174,7 @@ pytest tests/unit/test_my_feature.py::test_my_function -v
|
||||
| `app/domain/` | Models/Schemas | Data structures |
|
||||
| `app/infra/db/` | DB access | Queries, repositories |
|
||||
| `app/services/` | Business logic | Complex operations |
|
||||
| `app/native/api/` | Binary functions | Network simulation |
|
||||
| `app/native/wndb/` | Binary functions | Network simulation |
|
||||
| `app/core/` | Core utilities | Config, security, encryption |
|
||||
| `tests/` | Tests | Unit & integration tests |
|
||||
|
||||
@@ -203,7 +203,7 @@ from app.core.encryption import get_encryptor
|
||||
from app.core.config import settings
|
||||
|
||||
# Native API
|
||||
from app.native.api import get_all_junctions, add_junction, open_project
|
||||
from app.native.wndb import get_all_junctions, add_junction, open_project
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user