- Add PlatformReportService for reporting platform info to XPack official platform - Implement non-blocking background reporting to avoid impacting main operations - Add comprehensive error handling and timeout management - Integrate platform reporting into system configuration update workflow - Ensure reporting failures do not affect core business logic - Support both synchronous and asynchronous reporting modes - Add proper logging with appropriate levels for monitoring
1.3 KiB
1.3 KiB
XPack Open Source Edition - Copilot Programming Guidelines
Project Architecture
Service Dependencies
admin_serviceandapi_serviceare independent of each other, both depend oncommon- Follow layered architecture: Controller → Service → Repository
Directory Structure
services/
├── admin_service/ # Admin service
├── api_service/ # API service
└── common/ # Common modules
Coding Standards
Code Style
- Follow PEP 8, use type annotations and docstrings
- Naming: use
snake_casefor functions/variables,PascalCasefor classes - Imports: prioritize
services/common, avoid cross-service imports
Logging Requirements
- Must use English, use
services/common/logging_config.py - Format:
logger.info("Action completed: {context}") - Avoid sensitive information, include necessary context
Error Handling
- Use error messages defined in
services/common/error_msg.py - Unified exception handling and logging
Development Guidelines
- Think and analyze requirements first, wait for user confirmation before writing code
- Include appropriate logging (English format, consistent style)
- Add method-level English comments, keep them concise
- All comments must be written in English