HaniBlindBox/.kiro/specs/admin-bugfix/requirements.md
2026-01-20 20:31:51 +08:00

124 lines
6.0 KiB
Markdown

# Requirements Document
## Introduction
本文档定义了后台管理系统中 9 个未修复 BUG 的修复需求。这些 BUG 涉及统计报表、商品管理、营销活动和内容管理四个模块,主要问题类型包括接口请求失败、服务器内部错误、数据显示异常和功能不可用。
## Glossary
- **Admin_System**: 后台管理系统
- **Statistics_Module**: 统计报表模块
- **Goods_Module**: 商品管理模块
- **Marketing_Module**: 营销活动模块
- **Content_Module**: 内容管理模块
- **User_Profit_Stats**: 用户盈亏统计
- **User_Invite_Stats**: 用户邀请统计
- **Box_Management**: 盒子管理
- **Prize_Management**: 奖品管理
- **Claim_Record**: 领取记录
- **Weekly_Rank**: 周榜记录
- **Monthly_Rank**: 月榜记录
- **Danye_Management**: 单页管理
## Requirements
### Requirement 1: 用户盈亏统计搜索修复 (cs100_2)
**User Story:** As an administrator, I want to search user profit/loss statistics by user ID, so that I can analyze individual user's financial performance.
#### Acceptance Criteria
1. WHEN an administrator enters a user ID in the search field, THE Admin_System SHALL return the profit/loss statistics for that user
2. WHEN the search is executed, THE Admin_System SHALL NOT display "请求失败" error
3. THE Admin_System SHALL validate the user ID parameter before sending the request
4. THE Admin_System SHALL display appropriate message when no results are found
### Requirement 2: 用户邀请统计搜索修复 (cs100_3)
**User Story:** As an administrator, I want to search user invitation statistics by user ID, so that I can track user referral performance.
#### Acceptance Criteria
1. WHEN an administrator enters a user ID in the search field, THE Admin_System SHALL return the invitation statistics for that user
2. WHEN the search is executed, THE Admin_System SHALL NOT display "请求失败" error
3. THE Admin_System SHALL validate the user ID parameter before sending the request
4. THE Admin_System SHALL display appropriate message when no results are found
### Requirement 3: 盒子类型全部搜索修复 (cs100_4)
**User Story:** As an administrator, I want to search all box types when selecting "全部" filter, so that I can view the complete box list.
#### Acceptance Criteria
1. WHEN an administrator selects "全部" as box type filter, THE Admin_System SHALL return all boxes regardless of type
2. WHEN box type is "全部" (value 0 or empty), THE Admin_System SHALL skip the type filter condition in the query
3. THE Admin_System SHALL display the complete box list when "全部" is selected
4. THE Admin_System SHALL NOT return empty results when boxes exist in the database
### Requirement 4: 自动下架配置修复 (cs100_5)
**User Story:** As an administrator, I want to configure auto-delist settings when editing/creating a box, so that boxes can be automatically removed from listing.
#### Acceptance Criteria
1. WHEN an administrator enables "自动下架配置", THE Admin_System SHALL display the configuration parameters
2. THE Admin_System SHALL allow setting auto-delist time or conditions
3. WHEN the form is submitted, THE Admin_System SHALL save the auto-delist configuration correctly
4. THE Admin_System SHALL return auto-delist fields in the box detail response
### Requirement 5: 奖品等级分类显示修复 (cs100_6)
**User Story:** As an administrator, I want to see correct prize level and category names in the prize list, so that I can manage prizes effectively.
#### Acceptance Criteria
1. WHEN an administrator views the prize list, THE Admin_System SHALL display the correct level name (not "0级")
2. WHEN an administrator views the prize list, THE Admin_System SHALL display the correct category name (not "未知" or empty)
3. THE Admin_System SHALL perform proper join queries to fetch level and category information
4. THE Admin_System SHALL map the level and category fields correctly in the response DTO
### Requirement 6: 领取记录搜索修复 (cs100_11)
**User Story:** As an administrator, I want to search claim records by user ID, so that I can track user reward claims.
#### Acceptance Criteria
1. WHEN an administrator enters a user ID in the search field, THE Admin_System SHALL return the claim records for that user
2. WHEN the search is executed, THE Admin_System SHALL NOT display "请求失败" error
3. THE Admin_System SHALL validate the user ID parameter before sending the request
4. THE Admin_System SHALL display appropriate message when no results are found
### Requirement 7: 周榜记录修复 (cs100_13)
**User Story:** As an administrator, I want to view weekly ranking records, so that I can monitor weekly user performance.
#### Acceptance Criteria
1. WHEN an administrator accesses the weekly rank page, THE Admin_System SHALL display the ranking data
2. THE Admin_System SHALL NOT display "服务器内部错误"
3. THE Admin_System SHALL handle empty data gracefully
4. THE Admin_System SHALL calculate date ranges correctly for weekly data
### Requirement 8: 月榜记录修复 (cs100_14)
**User Story:** As an administrator, I want to view monthly ranking records, so that I can monitor monthly user performance.
#### Acceptance Criteria
1. WHEN an administrator accesses the monthly rank page, THE Admin_System SHALL display the ranking data
2. THE Admin_System SHALL NOT display "服务器内部错误"
3. THE Admin_System SHALL handle empty data gracefully
4. THE Admin_System SHALL calculate date ranges correctly for monthly data
### Requirement 9: 单页文章内容渲染修复 (cs100_15)
**User Story:** As an administrator, I want to view article content as rendered HTML, so that I can preview the actual display.
#### Acceptance Criteria
1. WHEN an administrator clicks on an article, THE Admin_System SHALL display rendered content (not raw HTML code)
2. THE Admin_System SHALL use v-html or equivalent to render HTML content
3. THE Admin_System SHALL sanitize HTML content to prevent XSS attacks
4. THE Admin_System SHALL preserve formatting and images in the rendered content