完善agent-insturction
This commit is contained in:
@@ -5,6 +5,8 @@ This is a FastAPI-based water network management system (供水管网智能管
|
|||||||
## Running the Server
|
## Running the Server
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# activate the server environment
|
||||||
|
conda activate server
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
@@ -17,6 +19,8 @@ python scripts/run_server.py
|
|||||||
## Running Tests
|
## Running Tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# activate the server environment
|
||||||
|
conda activate server
|
||||||
# Run all tests
|
# Run all tests
|
||||||
pytest
|
pytest
|
||||||
|
|
||||||
@@ -77,6 +81,7 @@ python tests/conftest.py
|
|||||||
- **Encryption**: Fernet symmetric encryption for sensitive data (`app.core.encryption`)
|
- **Encryption**: Fernet symmetric encryption for sensitive data (`app.core.encryption`)
|
||||||
|
|
||||||
Default admin accounts:
|
Default admin accounts:
|
||||||
|
|
||||||
- `admin` / `admin123`
|
- `admin` / `admin123`
|
||||||
- `tjwater` / `tjwater@123`
|
- `tjwater` / `tjwater@123`
|
||||||
|
|
||||||
@@ -95,9 +100,10 @@ Default admin accounts:
|
|||||||
|
|
||||||
- Database instances are initialized in `main.py` lifespan and stored in `app.state.db`
|
- Database instances are initialized in `main.py` lifespan and stored in `app.state.db`
|
||||||
- Access via dependency injection:
|
- Access via dependency injection:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from app.auth.dependencies import get_db
|
from app.auth.dependencies import get_db
|
||||||
|
|
||||||
async def endpoint(db = Depends(get_db)):
|
async def endpoint(db = Depends(get_db)):
|
||||||
# Use db connection
|
# Use db connection
|
||||||
```
|
```
|
||||||
@@ -177,10 +183,12 @@ await log_audit_event(
|
|||||||
### Database Migrations
|
### Database Migrations
|
||||||
|
|
||||||
SQL migration scripts are in `migrations/`:
|
SQL migration scripts are in `migrations/`:
|
||||||
|
|
||||||
- `001_create_users_table.sql`: User authentication tables
|
- `001_create_users_table.sql`: User authentication tables
|
||||||
- `002_create_audit_logs_table.sql`: Audit logging tables
|
- `002_create_audit_logs_table.sql`: Audit logging tables
|
||||||
|
|
||||||
Apply with:
|
Apply with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
psql -U postgres -d tjwater -f migrations/001_create_users_table.sql
|
psql -U postgres -d tjwater -f migrations/001_create_users_table.sql
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user