live-forum/.kiro/specs/cdk-activation/requirements.md
2026-03-24 11:27:37 +08:00

3.0 KiB
Raw Permalink Blame History

Requirements Document

Introduction

CDK 激活功能是团播机构 v1.2.0 的核心功能之一。该功能要求用户在进行发帖、回帖、送花等互动操作前,必须先激活 CDK。后台管理员可以批量创建 CDK并控制该功能的启用状态。

Glossary

  • CDK: Card Distribution Key激活码用于验证用户身份的唯一字符串
  • System: 团播机构系统,包含小程序端和后台管理端
  • User: 小程序端的普通用户
  • Admin: 后台管理端的管理员
  • Interactive_Operation: 互动操作,包括发帖、回帖、送花等需要 CDK 激活后才能执行的操作

Requirements

Requirement 1: 未激活用户的访问限制

User Story: As a User, I want to browse content without CDK activation, so that I can explore the platform before committing to activation.

Acceptance Criteria

  1. WHILE a User has not activated CDK, THE System SHALL allow the User to login and browse posts normally
  2. WHILE a User has not activated CDK, THE System SHALL prevent the User from performing Interactive_Operations
  3. WHEN a User without CDK activation attempts an Interactive_Operation, THE System SHALL display the CDK activation popup

Requirement 2: CDK 激活流程

User Story: As a User, I want to activate my account using a CDK, so that I can participate in interactive operations.

Acceptance Criteria

  1. WHEN a User enters a CDK and clicks the activate button, THE System SHALL validate the CDK
  2. WHEN the CDK has already been used, THE System SHALL display the message "该 CDK 已被激活"
  3. WHEN the CDK is valid and unused, THE System SHALL activate the User's account, close the popup, and display the message "CDK 激活成功"
  4. WHEN the CDK is invalid or does not exist, THE System SHALL display the message "请输入有效 CDK"
  5. WHEN a CDK is successfully used, THE System SHALL mark the CDK as used and record the User information

Requirement 3: 后台 CDK 管理

User Story: As an Admin, I want to batch create CDKs, so that I can distribute them to users efficiently.

Acceptance Criteria

  1. WHEN an Admin requests to generate CDKs, THE System SHALL create the specified quantity of unique CDK codes
  2. THE System SHALL ensure each CDK can only be used once
  3. WHEN a CDK is used, THE System SHALL display the used status and the User information who used it
  4. THE System SHALL provide a list view of all CDKs with their status and usage information

Requirement 4: CDK 功能开关

User Story: As an Admin, I want to enable or disable the CDK activation feature, so that I can control when this feature is active.

Acceptance Criteria

  1. THE Admin SHALL be able to toggle the CDK activation feature on or off
  2. WHILE the CDK feature is disabled, THE System SHALL allow all users to perform Interactive_Operations without CDK activation
  3. WHILE the CDK feature is enabled, THE System SHALL enforce CDK activation for Interactive_Operations
  4. WHEN the CDK feature status changes, THE System SHALL apply the change immediately to all users