Skip to content

Feature/yhl - #3382

Closed
prodDonkey wants to merge 6 commits into
QuantumNous:mainfrom
prodDonkey:feature/yhl
Closed

Feature/yhl#3382
prodDonkey wants to merge 6 commits into
QuantumNous:mainfrom
prodDonkey:feature/yhl

Conversation

@prodDonkey

@prodDonkey prodDonkey commented Mar 22, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

Release Notes

  • New Features

    • Added subscription plan redemption alongside quota redemption.
    • Enhanced top-up functionality to support both quota and subscription benefits.
    • Added support for multiple AI client integrations (Claude Code, Codex, OpenClaw, OpenCode).
  • Documentation

    • Launched comprehensive user documentation with API guides, quickstart tutorials, client configuration guides, and FAQ.
  • Updates

    • Added GPT-5.4 model variants with configured pricing ratios.

@coderabbitai

coderabbitai Bot commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8780a30e-a408-4077-a447-cc3c262b7bb0

📥 Commits

Reviewing files that changed from the base of the PR and between deff59a and 5285579.

⛔ Files ignored due to path filters (16)
  • docsify/images/1.png is excluded by !**/*.png
  • docsify/images/2.png is excluded by !**/*.png
  • docsify/images/3.png is excluded by !**/*.png
  • docsify/images/4.png is excluded by !**/*.png
  • docsify/images/5.png is excluded by !**/*.png
  • docsify/images/6.png is excluded by !**/*.png
  • docsify/images/61kj-logo.jpg is excluded by !**/*.jpg
  • docsify/images/998logo.png is excluded by !**/*.png
  • web/public/docs/images/1.png is excluded by !**/*.png
  • web/public/docs/images/2.png is excluded by !**/*.png
  • web/public/docs/images/3.png is excluded by !**/*.png
  • web/public/docs/images/4.png is excluded by !**/*.png
  • web/public/docs/images/5.png is excluded by !**/*.png
  • web/public/docs/images/6.png is excluded by !**/*.png
  • web/public/docs/images/61kj-logo.jpg is excluded by !**/*.jpg
  • web/public/docs/images/998logo.png is excluded by !**/*.png
📒 Files selected for processing (55)
  • AGENTS.md
  • CLAUDE.md
  • controller/redemption.go
  • controller/user.go
  • docker-compose.yml
  • docsify/README.md
  • docsify/_sidebar.md
  • docsify/api-chat.md
  • docsify/api-errors.md
  • docsify/api-intro.md
  • docsify/api-models.md
  • docsify/api-responses.md
  • docsify/assets/custom.css
  • docsify/cc-claude.md
  • docsify/cc-codex.md
  • docsify/cc-openclaw.md
  • docsify/cc-opencode.md
  • docsify/index.html
  • docsify/login.md
  • docsify/qa.md
  • docsify/quickstart.md
  • docsify/quota.md
  • docsify/register.md
  • docsify/token.md
  • model/redemption.go
  • model/redemption_test.go
  • setting/ratio_setting/cache_ratio.go
  • setting/ratio_setting/model_ratio.go
  • web/public/docs/README.md
  • web/public/docs/_sidebar.md
  • web/public/docs/api-chat.md
  • web/public/docs/api-errors.md
  • web/public/docs/api-intro.md
  • web/public/docs/api-models.md
  • web/public/docs/api-responses.md
  • web/public/docs/assets/custom.css
  • web/public/docs/cc-claude.md
  • web/public/docs/cc-codex.md
  • web/public/docs/cc-openclaw.md
  • web/public/docs/cc-opencode.md
  • web/public/docs/index.html
  • web/public/docs/login.md
  • web/public/docs/qa.md
  • web/public/docs/quickstart.md
  • web/public/docs/quota.md
  • web/public/docs/register.md
  • web/public/docs/token.md
  • web/src/components/table/redemptions/RedemptionsColumnDefs.jsx
  • web/src/components/table/redemptions/modals/EditRedemptionModal.jsx
  • web/src/components/topup/RechargeCard.jsx
  • web/src/components/topup/SubscriptionPlansCard.jsx
  • web/src/components/topup/index.jsx
  • web/src/components/topup/modals/SubscriptionPurchaseModal.jsx
  • web/src/helpers/render.jsx
  • web/src/index.jsx

Walkthrough

This PR introduces subscription plan redemption functionality with comprehensive Chinese documentation. Key changes include backend redemption logic with subscription plan support, frontend top-up UI components for redemption flows, extensive documentation for API endpoints and client configuration, project convention consolidation, Docker build configuration updates, and GPT-5.4 model ratio definitions.

Changes

Cohort / File(s) Summary
Documentation & Conventions
AGENTS.md, CLAUDE.md
Localized AGENTS.md to Chinese with new sections (commit conventions, git workflow, Docker deployment). CLAUDE.md consolidated to minimal entry delegating all rules to AGENTS.md.
Docsify Documentation
docsify/*
Added complete documentation site structure including index.html, sidebar navigation, API endpoints (chat, responses, models, errors), client configuration (Codex, Claude Code, OpenClaw, OpenCode), quickstart, login/registration/quota/token guides, Q&A, custom CSS theme, and assets.
Web Public Documentation
web/public/docs/*
Mirrored documentation suite matching docsify structure with README, sidebar, API guides, client setup tutorials, user guides, and themed CSS styling.
Backend Redemption Feature
controller/redemption.go, model/redemption.go, model/redemption_test.go, controller/user.go
Implemented subscription plan redemption: added input normalization and validation helper, structured RedeemResult return type with subscription data, updated database persistence to handle subscription fields, added integration tests for quota-only and quota+subscription redemptions. Updated TopUp controller to return subscription data alongside quota.
Frontend Top-up Components
web/src/components/topup/index.jsx, RechargeCard.jsx, SubscriptionPlansCard.jsx, modals/SubscriptionPurchaseModal.jsx
Enhanced top-up flow to support redemption code entry and subscription redemption. Added quota/subscription reload callbacks, plan selection with duration formatting, conditional quota validation, modal for redeem code input, and success feedback including subscription details.
Table & UI Components
web/src/components/table/redemptions/RedemptionsColumnDefs.jsx, modals/EditRedemptionModal.jsx
Added subscription plan title column with conditional rendering. Extended redemption modal with plan selection (fetching plans on mount), dynamic naming based on selected plan/quota, quota validation adjusted per plan selection, section label updates, and form state management for subscription fields.
Model & Cache Configuration
setting/ratio_setting/model_ratio.go, setting/ratio_setting/cache_ratio.go
Added model ratio and cache ratio entries for GPT-5.4 variants (gpt-5.4, mini, nano, pro with dated versions).
Infrastructure & Utilities
docker-compose.yml, web/src/helpers/render.jsx, web/src/index.jsx
Updated docker-compose to build locally from Dockerfile instead of using prebuilt image tag. Changed LinkedIn OAuth icon import from SimpleIcons to FontAwesome. Updated Semi UI CSS import path from semi.css to base.css.

Sequence Diagram(s)

sequenceDiagram
    actor User as User
    participant FE as Frontend Component
    participant API as Redemption Controller
    participant Model as Redemption Model
    participant DB as Database
    participant SubPlan as SubscriptionPlan Model

    User->>FE: Submit redemption code
    FE->>API: POST /api/user/topup {key, user_id}
    API->>API: Validate & normalize code
    API->>Model: Redeem(key, user_id)
    Model->>DB: Query redemption record
    DB-->>Model: Redemption data
    
    alt Quota > 0
        Model->>DB: Update user quota
    end
    
    alt SubscriptionPlanId > 0
        Model->>SubPlan: Fetch subscription plan
        SubPlan-->>Model: Plan details
        Model->>DB: Create user subscription
        DB-->>Model: Subscription created
        Model->>DB: Update redemption subscription fields
    end
    
    Model->>DB: Mark redemption as used
    DB-->>Model: Success
    Model-->>API: RedeemResult {Quota, Subscription}
    API-->>FE: {success, quota, subscription}
    FE->>FE: Reload user quota & subscriptions
    FE->>User: Display success with granted quota/subscription
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • Calcium-Ion
  • seefs001
  • creamlike1024

Poem

🐰 A rabbit hops through docs so fine,
Subscriptions redeemed, with codes that align!
From backend to frontend, the flow takes its course,
With Chinese prose guiding each data source.
Models configured, with ratios set bright—
New GPT-5.4 shines in the light! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

@prodDonkey prodDonkey closed this Mar 22, 2026
@prodDonkey
prodDonkey deleted the feature/yhl branch March 22, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant