新增:管理后台前端页面,以及openspec内容。
This commit is contained in:
124
openspec/changes/add-admin-web/specs/backend-admin/spec.md
Normal file
124
openspec/changes/add-admin-web/specs/backend-admin/spec.md
Normal file
@@ -0,0 +1,124 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Admin Web Application
|
||||
The system SHALL provide a web-based administrative interface for managing users and conversation records.
|
||||
|
||||
#### Scenario: Access admin web interface
|
||||
- **WHEN** an administrator navigates to the admin web URL
|
||||
- **THEN** the login page SHALL be displayed
|
||||
|
||||
#### Scenario: Admin web responsive design
|
||||
- **WHEN** the admin web is accessed from different devices
|
||||
- **THEN** the interface SHALL adapt to mobile (<768px) and desktop (>=768px) screen sizes
|
||||
|
||||
### Requirement: Admin Authentication
|
||||
The system SHALL provide authentication for accessing the admin web interface.
|
||||
|
||||
#### Scenario: Admin login success
|
||||
- **WHEN** valid admin credentials are provided
|
||||
- **THEN** the user SHALL be redirected to the dashboard
|
||||
- **AND** an authentication token SHALL be stored in localStorage
|
||||
|
||||
#### Scenario: Admin login failure
|
||||
- **WHEN** invalid credentials are provided
|
||||
- **THEN** an error message SHALL be displayed
|
||||
- **AND** the user SHALL remain on the login page
|
||||
|
||||
#### Scenario: Admin logout
|
||||
- **WHEN** the user clicks the logout button
|
||||
- **THEN** the authentication token SHALL be removed from localStorage
|
||||
- **AND** the user SHALL be redirected to the login page
|
||||
|
||||
#### Scenario: Protected route access without authentication
|
||||
- **WHEN** an unauthenticated user attempts to access a protected route
|
||||
- **THEN** the user SHALL be redirected to the login page
|
||||
|
||||
### Requirement: User Management
|
||||
The system SHALL provide an interface for managing users.
|
||||
|
||||
#### Scenario: View user list
|
||||
- **WHEN** the user navigates to the user management page
|
||||
- **THEN** a list of users SHALL be displayed in a table
|
||||
- **AND** the table SHALL include UserKey, UserName, WeChatName, PhoneNumber, Department, and IsDisabled columns
|
||||
|
||||
#### Scenario: Search users
|
||||
- **WHEN** the user enters a search term
|
||||
- **THEN** the user list SHALL be filtered to show matching users
|
||||
|
||||
#### Scenario: Paginate user list
|
||||
- **WHEN** the user navigates between pages
|
||||
- **THEN** the user list SHALL display the appropriate page of results
|
||||
- **AND** page size SHALL be configurable
|
||||
|
||||
### Requirement: Conversation Management
|
||||
The system SHALL provide an interface for managing conversation records.
|
||||
|
||||
#### Scenario: View conversation list
|
||||
- **WHEN** the user navigates to the conversation management page
|
||||
- **THEN** a list of conversations SHALL be displayed in a table
|
||||
- **AND** the table SHALL include Guid, UserKey, MessageType, RecordTimeUTCStamp, and IsDeleted columns
|
||||
|
||||
#### Scenario: Filter conversations by message type
|
||||
- **WHEN** the user selects a message type filter
|
||||
- **THEN** the conversation list SHALL be filtered to show only conversations of that type
|
||||
|
||||
#### Scenario: Search conversations
|
||||
- **WHEN** the user enters a search term
|
||||
- **THEN** the conversation list SHALL be filtered to show matching conversations
|
||||
|
||||
#### Scenario: Paginate conversation list
|
||||
- **WHEN** the user navigates between pages
|
||||
- **THEN** the conversation list SHALL display the appropriate page of results
|
||||
|
||||
### Requirement: Dashboard
|
||||
The system SHALL provide a dashboard with system overview information.
|
||||
|
||||
#### Scenario: View dashboard
|
||||
- **WHEN** the user navigates to the dashboard
|
||||
- **THEN** statistics cards SHALL be displayed showing total users and total conversations
|
||||
- **AND** recent activity SHALL be shown
|
||||
|
||||
### Requirement: Theme Switching
|
||||
The system SHALL support dark and light theme switching.
|
||||
|
||||
#### Scenario: Switch to dark theme
|
||||
- **WHEN** the user clicks the dark theme toggle
|
||||
- **THEN** the interface SHALL switch to dark mode
|
||||
- **AND** the preference SHALL be saved in localStorage
|
||||
|
||||
#### Scenario: Switch to light theme
|
||||
- **WHEN** the user clicks the light theme toggle
|
||||
- **THEN** the interface SHALL switch to light mode
|
||||
- **AND** the preference SHALL be saved in localStorage
|
||||
|
||||
#### Scenario: Persist theme preference
|
||||
- **WHEN** the user returns to the admin web
|
||||
- **THEN** the previously selected theme SHALL be applied
|
||||
|
||||
### Requirement: Layout and Navigation
|
||||
The system SHALL provide a consistent layout with navigation.
|
||||
|
||||
#### Scenario: Navigate between pages
|
||||
- **WHEN** the user clicks a navigation menu item
|
||||
- **THEN** the corresponding page SHALL be displayed
|
||||
- **AND** the active menu item SHALL be highlighted
|
||||
|
||||
#### Scenario: Responsive sidebar
|
||||
- **WHEN** the screen width is less than 768px
|
||||
- **THEN** the sidebar SHALL be collapsible
|
||||
- **AND** a hamburger menu SHALL be displayed
|
||||
|
||||
### Requirement: HTTP Client
|
||||
The system SHALL provide a configured HTTP client for API communication.
|
||||
|
||||
#### Scenario: API request with authentication
|
||||
- **WHEN** an authenticated user makes an API request
|
||||
- **THEN** the authentication token SHALL be included in the request headers
|
||||
|
||||
#### Scenario: API error handling
|
||||
- **WHEN** an API request fails
|
||||
- **THEN** an appropriate error message SHALL be displayed to the user
|
||||
|
||||
#### Scenario: API request timeout
|
||||
- **WHEN** an API request times out
|
||||
- **THEN** a timeout error message SHALL be displayed
|
||||
Reference in New Issue
Block a user