docs(reward): 设计文档 webhook 路径 /tg/webhook→/v1/tg/webhook + app_text 首充注释 15→7
ci-pangolin / Lint — shellcheck (pull_request) Successful in 10s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 25s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 19s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 36s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 3s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 3s
ci-pangolin / Go — build + test (pull_request) Failing after 13s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 10s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Successful in 4m28s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 20s
ci-pangolin / OpenAPI Sync Check (pull_request) Failing after 14m23s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Failing after 14m35s
ci-pangolin / Lint — shellcheck (pull_request) Successful in 10s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 25s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 19s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 36s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 3s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 3s
ci-pangolin / Go — build + test (pull_request) Failing after 13s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 10s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Successful in 4m28s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 20s
ci-pangolin / OpenAPI Sync Check (pull_request) Failing after 14m23s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Failing after 14m35s
终审指出:实际路由挂在 /v1 组下,setWebhook 须指向 https://api.yanmeiai.com/v1/tg/webhook; app_text.dart:603 抽象 getter 上的过时「15 天」注释一并订正为 7。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -600,7 +600,7 @@ abstract class AppText {
|
||||
String get inviteCopyLink; // 复制链接 / Copy link
|
||||
String get inviteRewardsTitle; // 奖励规则 / Rewards
|
||||
String get inviteRewardRegister; // 好友注册 · 双方各得 3 天 / Sign up · +3 days each
|
||||
String get inviteRewardFirstBuy; // 好友首购 · 双方各得 15 天 / First purchase · +15 days each
|
||||
String get inviteRewardFirstBuy; // 好友首购 · 双方各得 7 天 / First purchase · +7 days each
|
||||
String get inviteRewardJoinTg; // 加入 TG 频道 · 得 3 天 / Join TG · +3 days
|
||||
String get inviteProgressTitle; // 我的奖励 / My rewards
|
||||
String get inviteTasksTitle; // 更多得会员 / More ways to earn
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<tr><td>pay <code>webhook.settle()</code></td><td>首充钩子:在 <code>GrantPaidSubscriptionTx</code> 之后,若 <code>users.first_paid_at</code> 本次由空转非空(=首充)且该用户是被邀请人(<code>referrals</code> 命中)→ 发首充段双方 +7(<code>paid_rewarded</code>,幂等)。</td></tr>
|
||||
<tr><td><code>GET /v1/invite</code></td><td>我的邀请码 / 链接 + 战绩:已邀请数、已转化(首充)数、累计获赠天数、明细列表;附奖励任务清单(TG 完成态)。</td></tr>
|
||||
<tr><td><code>GET /v1/tasks/telegram/start</code></td><td>签发绑定 token(10 分钟有效、绑当前账户),返回 bot 深链 <code>t.me/<reward_bot>?start=<token></code>。</td></tr>
|
||||
<tr><td><code>POST /tg/webhook</code></td><td>Telegram Bot 更新回调(secret 校验,与 pay webhook 同款外部回调):收 <code>/start <token></code> → 校验成员 → 发 TG 任务 +3。详见 §5。</td></tr>
|
||||
<tr><td><code>POST /v1/tg/webhook</code></td><td>Telegram Bot 更新回调(secret 校验,与 pay webhook 同款外部回调):收 <code>/start <token></code> → 校验成员 → 发 TG 任务 +3。详见 §5。</td></tr>
|
||||
</table>
|
||||
|
||||
<h2>5 · TG 任务验证流程(Bot getChatMember)</h2>
|
||||
@@ -158,7 +158,7 @@
|
||||
<g stroke="#8b93a3" marker-end="url(#ah)"><line x1="135" y1="132" x2="690" y2="132"/></g>
|
||||
<text x="150" y="126" fill="#a8afbd">③ 拉起 bot,用户按 Start(/start token)</text>
|
||||
<g stroke="#8b93a3" marker-end="url(#ah)"><line x1="695" y1="160" x2="415" y2="160"/></g>
|
||||
<text x="420" y="154" fill="#a8afbd">④ POST /tg/webhook(update:token + telegram_id)</text>
|
||||
<text x="420" y="154" fill="#a8afbd">④ POST /v1/tg/webhook(update:token + telegram_id)</text>
|
||||
<g stroke="#e0884f" marker-end="url(#ah)"><line x1="410" y1="188" x2="690" y2="188"/></g>
|
||||
<text x="415" y="182" fill="#e0a06a">⑤ getChatMember(频道, telegram_id)</text>
|
||||
<g stroke="#5ec27a" marker-end="url(#ah)"><line x1="695" y1="216" x2="415" y2="216"/></g>
|
||||
@@ -186,7 +186,7 @@
|
||||
<ul>
|
||||
<li>建一个<b>面向用户的 Bot</b>(与运维告警 bot 分开),token 存 <code>TG_REWARD_BOT_TOKEN</code>(Bitwarden,不入 git)。</li>
|
||||
<li>把该 Bot <b>设为频道管理员</b> —— 否则 <code>getChatMember</code> 查不到成员。</li>
|
||||
<li>配 <code>TG_REWARD_CHANNEL</code>(如 <code>@pangolin_app</code>)、<code>TG_WEBHOOK_SECRET</code>;向 Telegram <code>setWebhook</code> 指向 <code>https://api.yanmeiai.com/tg/webhook</code>。</li>
|
||||
<li>配 <code>TG_REWARD_CHANNEL</code>(如 <code>@pangolin_app</code>)、<code>TG_WEBHOOK_SECRET</code>;向 Telegram <code>setWebhook</code> 指向 <code>https://api.yanmeiai.com/v1/tg/webhook</code>(路由挂在 <code>/v1</code> 组下,真实路径含 <code>/v1</code> 前缀)。</li>
|
||||
<li>未配 <code>TG_REWARD_BOT_TOKEN</code> 时,TG 任务卡在 App 里<b>整卡隐藏</b>(邀请功能不受影响,优雅降级)。</li>
|
||||
</ul>
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
server/internal/auth/service.go <span class="cm"># Register 加 inviteCode + 建 referrals + 注册段发奖</span>
|
||||
server/internal/reward/ <span class="cm"># 新包:邀请/任务发奖 + 防刷闸 + getChatMember</span>
|
||||
server/internal/pay/webhook.go <span class="cm"># settle() 首充钩子接首充段发奖</span>
|
||||
server/internal/httpapi/ <span class="cm"># GET /v1/invite、/v1/tasks/telegram/start、POST /tg/webhook</span>
|
||||
server/internal/httpapi/ <span class="cm"># GET /v1/invite、/v1/tasks/telegram/start、POST /v1/tg/webhook</span>
|
||||
server/migrations/{mysql,sqlite}/ <span class="cm"># users +2 列、referrals、reward_claims</span>
|
||||
<span class="cm"># 客户端</span>
|
||||
client/lib/screens/invite_page.dart <span class="cm"># 占位 → 真实(邀请区 + 任务区)</span>
|
||||
|
||||
Reference in New Issue
Block a user