From 2464c7f612113365e6a5dfa170e92aba44495ef7 Mon Sep 17 00:00:00 2001 From: Jiang Date: Wed, 4 Mar 2026 16:04:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84agent-insturction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/copilot-instructions.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 6ff37dc..74b0b6c 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -5,6 +5,8 @@ This is a FastAPI-based water network management system (供水管网智能管 ## Running the Server ```bash +# activate the server environment +conda activate server # Install dependencies pip install -r requirements.txt @@ -17,6 +19,8 @@ python scripts/run_server.py ## Running Tests ```bash +# activate the server environment +conda activate server # Run all tests pytest @@ -77,6 +81,7 @@ python tests/conftest.py - **Encryption**: Fernet symmetric encryption for sensitive data (`app.core.encryption`) Default admin accounts: + - `admin` / `admin123` - `tjwater` / `tjwater@123` @@ -95,9 +100,10 @@ Default admin accounts: - Database instances are initialized in `main.py` lifespan and stored in `app.state.db` - Access via dependency injection: + ```python from app.auth.dependencies import get_db - + async def endpoint(db = Depends(get_db)): # Use db connection ``` @@ -177,10 +183,12 @@ await log_audit_event( ### Database Migrations SQL migration scripts are in `migrations/`: + - `001_create_users_table.sql`: User authentication tables - `002_create_audit_logs_table.sql`: Audit logging tables Apply with: + ```bash psql -U postgres -d tjwater -f migrations/001_create_users_table.sql ```