feat: 重构项目心跳为Redis LIST并更新相关文档

重构项目心跳数据结构为Redis LIST,更新相关文档和OpenSpec规范。主要变更包括:
- 将项目心跳从STRING改为LIST类型
- 更新后端服务以支持LIST操作
- 同步更新文档和OpenSpec规范
- 统一后端端口为3001
- 添加部署指南和Windows部署文档

修复前端API请求路径,移除硬编码的localhost地址。添加PM2和Nginx配置文件模板,完善部署流程文档。更新Redis集成协议文档,明确LIST数据结构和外部项目对接规范。
This commit is contained in:
2026-01-17 18:36:52 +08:00
parent a8faa7dcaa
commit 7ac3949dfa
40 changed files with 4179 additions and 323 deletions

View File

@@ -1,34 +1,35 @@
# Command Capability Specification
## Overview
This specification defines the command capability for the BLS Project Console, which allows users to send console commands to Redis queues for other programs to read and execute.
This specification defines the command capability for the BLS Project Console, which allows users to send console commands to target project HTTP APIs.
## Requirements
### Requirement: Command Sending to Redis
The system SHALL send commands to a Redis queue.
The system SHALL send commands to a target project's HTTP API.
#### Scenario: Sending a command to Redis queue
#### Scenario: Sending a command to target project API
- **WHEN** the user enters a command in the console
- **AND** clicks the "Send" button
- **THEN** the command SHALL be sent to the Redis queue
- **AND** the user SHALL receive a success confirmation
- **THEN** the backend SHALL resolve `apiBaseUrl` from the project's heartbeat
- **AND** it SHALL call `POST {apiBaseUrl}/{apiName}` with a structured payload
- **AND** the user SHALL receive a success confirmation if upstream returns 2xx
### Requirement: Command Validation
The system SHALL validate commands before sending them to Redis.
The system SHALL validate commands before sending them to target project API.
#### Scenario: Validating an empty command
- **WHEN** the user tries to send an empty command
- **THEN** the system SHALL display an error message
- **AND** the command SHALL NOT be sent to Redis
- **AND** the command SHALL NOT be sent
#### Scenario: Validating a command with invalid characters
- **WHEN** the user tries to send a command with invalid characters
- **THEN** the system SHALL display an error message
- **AND** the command SHALL NOT be sent to Redis
- **AND** the command SHALL NOT be sent
### Requirement: Command History
The system SHALL maintain a history of sent commands.
The system SHALL maintain a history of sent commands in the console UI.
#### Scenario: Viewing command history
- **WHEN** the user opens the command history
@@ -36,12 +37,11 @@ The system SHALL maintain a history of sent commands.
- **AND** the user SHALL be able to select a command from the history to resend
### Requirement: Command Response Handling
The system SHALL handle responses from commands sent to Redis.
The system SHALL handle responses from commands sent to target project API.
#### Scenario: Receiving a command response
- **WHEN** a command response is received from Redis
- **THEN** the system SHALL display the response in the console
- **AND** the response SHALL be associated with the original command
- **WHEN** the target project API responds
- **THEN** the system SHALL display the response status in the console
## Data Model