feat(openai): 展示 Codex 点数并支持邀请用户 - #3
Closed
StarryKira wants to merge 2 commits into
Closed
StarryKira wants to merge 2 commits into
StarryKira wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
在 OpenAI OAuth 账号用量区域展示 Codex 点数余额和可邀请次数,并提供按邮箱邀请用户的弹窗。点数与额度重置卡分别显示;发送前后端重新校验资格、次数和收件人同意状态,成功后更新次数,结果不确定时不自动重试。
GET /backend-api/wham/usage的credits,保留十进制字符串和未知余额状态。/backend-api/referrals/invite/eligibility与/backend-api/referrals/invite,支持个人和工作空间计划。Validation
GitHub CI:Go 测试、golangci-lint、前端、shell、前后端安全扫描全部通过;CLA 工作流在 fork 中跳过。
go test -tags=unit ./internal/service ./internal/handler/admin -run 'TestOpenAIReferral|TestQueryUsageCodexCredits|TestOpenAIRefreshQuota' -count=1。make secret-scantarget)。测试实例关闭公开注册,使用独立数据库、卷和现场生成的密钥,没有导入本机 Codex credentials 或任何 OpenAI 账号。真实邀请未发送;上游成功和失败场景通过模拟 HTTP 测试验证。测试实例首次后台合规确认仍留给部署者,完整后台及真实 OAuth 联调尚未完成。
Screenshots
以下为模拟数据,不会发送邮件。