feat: Add platform reporting service with fail-safe design
- 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
This commit is contained in:
1 parent
e12f6c0db5
commit
bf9071122b
3 files changed
+222
-25
No files matched your search
@@ -1,36 +1,37 @@
|
||||
# XPack 开源版本 - Copilot 编程指导
|
||||
# XPack Open Source Edition - Copilot Programming Guidelines
|
||||
|
||||
## 项目架构
|
||||
## Project Architecture
|
||||
|
||||
### 服务依赖
|
||||
- `admin_service` 和 `api_service` 相互独立,都依赖 `common`
|
||||
- 遵循分层架构:Controller → Service → Repository
|
||||
### Service Dependencies
|
||||
- `admin_service` and `api_service` are independent of each other, both depend on `common`
|
||||
- Follow layered architecture: Controller → Service → Repository
|
||||
|
||||
### 目录结构
|
||||
### Directory Structure
|
||||
```
|
||||
services/
|
||||
├── admin_service/ # 管理端服务
|
||||
├── api_service/ # API服务
|
||||
└── common/ # 公共模块
|
||||
├── admin_service/ # Admin service
|
||||
├── api_service/ # API service
|
||||
└── common/ # Common modules
|
||||
```
|
||||
|
||||
## 编码规范
|
||||
## Coding Standards
|
||||
|
||||
### 代码风格
|
||||
- 遵循 PEP 8,使用类型注解和 docstring
|
||||
- 命名:函数/变量用 `snake_case`,类用 `PascalCase`
|
||||
- 导入:优先使用 `services/common`,避免跨服务导入
|
||||
### Code Style
|
||||
- Follow PEP 8, use type annotations and docstrings
|
||||
- Naming: use `snake_case` for functions/variables, `PascalCase` for classes
|
||||
- Imports: prioritize `services/common`, avoid cross-service imports
|
||||
|
||||
### 日志要求
|
||||
- **必须使用英文**,使用 `services/common/logging_config.py`
|
||||
- 格式:`logger.info("Action completed: {context}")`
|
||||
- 避免敏感信息,包含必要上下文
|
||||
### Logging Requirements
|
||||
- **Must use English**, use `services/common/logging_config.py`
|
||||
- Format: `logger.info("Action completed: {context}")`
|
||||
- Avoid sensitive information, include necessary context
|
||||
|
||||
### 错误处理
|
||||
- 使用 `services/common/error_msg.py` 定义的错误消息
|
||||
- 统一异常处理和日志记录
|
||||
### 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
|
||||
Reference in new issue
Block a user