wangjia
|
68608d6471
|
feat(server/auth): 新用户注册欢迎通知——注册同事务插 reward 类到账(零孤儿)
ci-pangolin / Lint — shellcheck (pull_request) Successful in 13s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 24s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 20s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 34s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 22s
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 4s
ci-pangolin / Go — build + test (pull_request) Failing after 13s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 11s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 4m37s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 19s
CreateUserWithTrial 新增本地 Noticer 接口(同 InsertNoticeTx 签名,参照 reward
包做法避免 notices→auth 循环依赖);SQLStore 加 noticer 字段 + SetNoticer,
nil-safe。注册事务插完 trial 订阅、commit 前,若已注入 noticer 则同事务插一条
type=reward 的双语欢迎通知(标题/正文按 trialDays 参数化),失败即整事务回滚,
与 reward/pay 到账钩子同语义、零孤儿。main.go 在 noticesStore 构造后装配
authStore.SetNoticer(noticesStore)(authStore 提升到 if-block 外声明以跨块可见)。
顺带修复 isDuplicateKey 只认 MySQL 错误文案的 dialect 缺口——sqlite 下重复邮箱
注册此前会落入错误分支返回不透明的「auth: insert user」,而非 ErrEmailTaken;
现同时匹配 sqlite 的 "UNIQUE constraint failed"。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9G7E3wmAYL9KeYCVZVsqu
|
2026-07-13 19:03:18 +08:00 |
|
wangjia
|
a62a2b1797
|
fix(server/pay): promo 限购 settle 侧幂等复查 + 000027 部分唯一索引(TOCTOU)
ci-pangolin / Lint — shellcheck (pull_request) Successful in 11s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 25s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 19s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 41s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 20s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 4s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 5s
ci-pangolin / Go — build + test (pull_request) Failing after 14s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 11s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 4m44s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 20s
ci-pangolin / Flutter — analyze + test (pull_request) Failing after 11m55s
CreateOrder 下单时的 HasPaidPurchase 只是裸 SELECT 无锁,并发/多挂起单可绕过
promo SKU「每账号限购一次」。两层修:
① webhook.go settle 在锁行、开通前对 item.Promo 的 SKU 复查一次(排除本单),
命中说明另一笔同 user+SKU 订单已抢先 settle,跳过发放(不二次 +N 天)、
仍 ack(否则 pay 无限重投)。新增 store.HasPaidPurchaseExcludingTx /
MarkDuplicatePromoTx——重复单标记 canceled 而非 paid,避免自撞下面的
唯一索引、也避免整笔 500 触发死循环重投。
② migration 000027(sqlite):部分唯一索引 ux_pay_promo_paid ON
pay_purchases(user_id, sku) WHERE status='paid' AND sku='pro_month_promo',
兜底防止任何路径把同一用户的 promo 单二次写成 paid。mysql 8 不支持部分
索引,000027 mysql 侧是 no-op 占位(仅对齐编号),该场景 mysql 只靠①的
应用层复查兜底——两库防线强度不同,已在迁移文件与代码注释中记录。
副作用:新增迁移把 sqlite 迁移顶点从 26 推到 27,同步更新
internal/store/sqlite_migrate_test.go 的版本断言,以及
internal/store/codes_lib_migrate_test.go 手动 Steps(-1) 序列(补一步跳过
000027,才能精确落在 000022 边界,这条测试是硬编码步数的)。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-13 15:53:56 +08:00 |
|
wangjia
|
1e102a5a79
|
fix(server/nodes): 连接设备上限闸读 max_devices_override(登录闸已读,连接闸漏)
EntitlementForUser 是每次连接 backstop(httpapi/nodes.go DEVICE_LIMIT_EXCEEDED)
唯一读的设备上限来源,但订阅命中分支与 free 兜底分支都从未读 users.max_devices_override
(migration 000025)——运营设 override 只对登录闸(devices.ResolvePlan)生效,一连 VPN
仍按套餐默认上限被拒。两分支统一叠加 override(NULL/<=0 不生效,正值覆盖,语义与
devices/store.go:GetMaxDevicesOverride 一致),新增 sqlite 用例覆盖 free 无覆盖/
free 覆盖/pro 覆盖收紧/NULL-0 不生效四种场景。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
2026-07-13 15:47:15 +08:00 |
|
wangjia
|
ed99e2943e
|
fix(openapi): Notice.id string/uuid→integer/int64 + body_zh/en 移出 required(对齐实际实现,终审建议)
ci-pangolin / Lint — shellcheck (pull_request) Successful in 9s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 27s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 17s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 40s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 22s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 37s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 4s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 3s
ci-pangolin / Go — build + test (pull_request) Failing after 12s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 9s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 8m9s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 19s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-07-13 14:22:00 +08:00 |
|
wangjia
|
2b4350cfc4
|
feat(server): 装配 notices(路由替换空壳+reward/pay 注入)+ 发版联动插 version 公告
main.go 挂载 notices.Store/Handler:注入 rewardSvc/payWebhook 到账通知钩子,
/v1/notices 路由由 accountAPI 空壳换成真实 List/MarkRead,删除 account.go
的 TODO 空壳方法。补齐 pangolin-nodectl 到编译/部署产物链
(compile-backend.sh + deploy-server.sh),release-client.sh 在
version.yaml 推送成功后追加一步用 nodectl 插入 version 类型站内公告
(失败不阻断发版)。
|
2026-07-13 14:09:54 +08:00 |
|
wangjia
|
84b162e834
|
feat(nodectl): notice add/list/revoke 子命令(校验+审计+可选邮件)
|
2026-07-13 14:01:50 +08:00 |
|
wangjia
|
75ec361542
|
feat(server/notices): Service — 发布校验/审计/important 邮件兜底(幂等)
|
2026-07-13 13:51:28 +08:00 |
|
wangjia
|
e1e198e169
|
feat(server): 到账通知四接缝(邀请注册/首充/TG/购买开通)——与发放同事务零孤儿
|
2026-07-13 13:49:09 +08:00 |
|
wangjia
|
0325603470
|
feat(server/notices): GET /v1/notices(合并+unread_count)+ POST /read + openapi 扩展
|
2026-07-13 13:43:50 +08:00 |
|
wangjia
|
ed1f805cbc
|
feat(server/notices): Store — 广播∪定向合并查询/已读水位/事务内插通知
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9G7E3wmAYL9KeYCVZVsqu
|
2026-07-13 13:36:32 +08:00 |
|
wangjia
|
21a30aa4c8
|
feat(server/migrate): 000026 notices 表 + users.notices_read_at 已读水位
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9G7E3wmAYL9KeYCVZVsqu
|
2026-07-13 13:32:23 +08:00 |
|
wangjia
|
94266804bc
|
fix(server/reward): 邀请发放审计 target 带对方 id(invite:reg:invitee=N 等,替换静态占位串)——审计可回答「因谁而发」
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 24s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 22s
ci-pangolin / Lint — shellcheck (pull_request) Successful in 6s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 34s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 31s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 3s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 4s
ci-pangolin / Go — build + test (pull_request) Failing after 9s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 11s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 4m37s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 19s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Failing after 14m46s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-07-13 12:24:27 +08:00 |
|
wangjia
|
2c94b53a9e
|
fix(server/reward): TG bot 回复区分已领取/未加入两态 + 按 Telegram language_code 中英双语
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 24s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 23s
ci-pangolin / Lint — shellcheck (pull_request) Successful in 6s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 36s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 34s
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 11s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 10s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Failing after 10m52s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 4m33s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 19s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9G7E3wmAYL9KeYCVZVsqu
|
2026-07-13 11:46:55 +08:00 |
|
wangjia
|
1c2ec2844d
|
feat(server/pay): 优惠套餐(Promo SKU)每账号限购一次——已付过再下单 409 PROMO_ALREADY_USED
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 23s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 17s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 18s
ci-pangolin / Lint — shellcheck (pull_request) Successful in 6s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 35s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 32s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 3s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 4s
ci-pangolin / Go — build + test (pull_request) Failing after 10s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 9s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 4m40s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 21s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9G7E3wmAYL9KeYCVZVsqu
|
2026-07-13 11:36:24 +08:00 |
|
wangjia
|
07c339c18e
|
feat(server/devices): users.max_devices_override 单用户设备上限覆盖(NULL走套餐默认)+ 迁移000025
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 23s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 16s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 39s
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 4s
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) Failing after 5m8s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 19s
ci-pangolin / Lint — shellcheck (pull_request) Failing after 13m37s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P9G7E3wmAYL9KeYCVZVsqu
|
2026-07-13 10:15:07 +08:00 |
|
wangjia
|
488688aeac
|
fix(reward): TG webhook 空 secret fail-fast + 首充奖励文案六语 15→7(终审必修)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-07-13 08:17:11 +08:00 |
|
wangjia
|
c29aaf9a2a
|
feat(server): 装配 reward 服务 — 注入 auth/webhook + 挂 /v1/invite、/tasks/telegram/start、/tg/webhook
|
2026-07-13 08:01:01 +08:00 |
|
wangjia
|
e26284d072
|
feat(server/reward): TG getChatMember 真校验 + ClaimTelegram + POST /tg/webhook
|
2026-07-13 07:54:46 +08:00 |
|
wangjia
|
e23cd5e1bd
|
feat(server/reward): TG 绑定 token 签发/消费 + GET /v1/tasks/telegram/start
|
2026-07-13 07:49:31 +08:00 |
|
wangjia
|
d23f7bca8f
|
feat(server/reward): GET /v1/invite — 邀请码/链接/战绩/TG 任务态
|
2026-07-13 07:46:07 +08:00 |
|
wangjia
|
de1117b0e6
|
feat(server/pay): 首充钩子 — settle 内接邀请首充段发奖(first_paid_at 幂等)
|
2026-07-13 07:41:15 +08:00 |
|
wangjia
|
54d106ca8b
|
feat(server/auth): Register 加 inviteCode + ReferralHook(注册后 best-effort 归因)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-07-13 07:33:42 +08:00 |
|
wangjia
|
2fb7391a17
|
feat(server/reward): OnRegister 绑定 + 注册段双方发奖 + 自邀请/设备/月封顶防刷
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
2026-07-13 07:27:10 +08:00 |
|
wangjia
|
2bd31bbd55
|
fix(server/reward): isDup 收窄到 unique/duplicate 防误判 FK/NOTNULL + 补 referrals 唯一路径测试
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-07-13 07:19:41 +08:00 |
|
wangjia
|
75636c8ea3
|
feat(server/reward): Store — referrals/reward_claims/invite_code 数据访问 + 唯一守卫
|
2026-07-13 07:15:28 +08:00 |
|
wangjia
|
0695c7958b
|
feat(server/codes): GrantRewardTx 复用 applySubscription 发奖励会员天数
|
2026-07-13 07:11:17 +08:00 |
|
wangjia
|
52b5e90d92
|
fix(server/migrate): 000024 sqlite 重建 subscriptions 后补回 idx_subs_user_exp 索引 + 回归断言
000024 迁移重建 subscriptions 表(source CHECK 扩容)时未重新创建
idx_subs_user_exp(user_id, expires_at)索引,导致 SQLite(生产 pangolin1
实际驱动)上订阅按 user_id/expires_at 查询退化为全表扫描。up/down 均补回
CREATE INDEX,并在 TestSQLiteMigrateUpDown 里加断言防止再次静默丢失。
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
2026-07-13 07:08:26 +08:00 |
|
wangjia
|
9b858c5224
|
feat(server/migrate): 000024 邀请奖励表 + subscriptions.source 扩 invite/task
|
2026-07-13 06:59:52 +08:00 |
|
wangjia
|
7ac9fa40f0
|
feat(server/pay): catalog 加全员优惠月付 pro_month_promo(¥6/$1)+ Promo 标记
优惠档全员可见,客户端用特殊卡片展示;pay 侧需种同 biz_code 商品后方可真下单
(未种前 product_not_found→404,UI 先就绪)。catalog 测试更新为 4 档 + promo 断言。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-12 19:27:34 +08:00 |
|
wangjia
|
b9e2f8c2da
|
feat(server/pay): 订单展示层过期态(created 超 TTL 显 expired,零迁移)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-07-12 17:18:02 +08:00 |
|
wangjia
|
b30f472d90
|
fix(server/pay): 订单展示金额兜底 — 老单 amount_minor=0 回退档位展示价(按方式结算币种)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-12 06:54:18 +08:00 |
|
wangjia
|
a5adbf347b
|
feat(server/pay): 订单列表端点 + 分币种展示价 + 富字段详情
- GET /v1/pay/orders 订单列表(Store.ListByUser,本地台账倒序)
- catalog 增 PriceUsdtMicro(USDT 一口价展示) + SettlementCurrency/DisplayAmountMinor
- 下单按支付方式落展示金额/结算币种(crypto→USDT / 法币→CNY),webhook 覆盖实际
- GetOrder 详情回带 sku/plan/method/amount/currency/created_at/paid_at
- 新增 List 越权/倒序/富字段 + 分币种展示金额 + 详情富字段测试
- 修 3 个 pre-existing 迁移测试(renumber 后 21→23 遗留)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-11 23:45:21 +08:00 |
|
wangjia
|
43c76fb978
|
Merge remote-tracking branch 'origin/main' into feat/pay-v2-integration
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Successful in 25s
ci-pangolin / Lint — shellcheck (push) Successful in 29s
ci-pangolin / Cleartext Scan — Android 禁明文 (push) Successful in 22s
ci-pangolin / OpenAPI Sync Check (push) Successful in 40s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (push) Successful in 19s
ci-pangolin / Flutter — analyze + test (push) Failing after 4m59s
ci-pangolin / Codegen Drift — token 生成物未漂移 (push) Successful in 1m51s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (push) Successful in 5s
ci-pangolin / Go — build + test (push) Failing after 1m33s
ci-pangolin / E2E Smoke — L4 进程级端到端 (push) Failing after 14s
ci-pangolin / Go — integration (mysql/redis testcontainers) (push) Failing after 4m59s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (push) Failing after 4s
# Conflicts:
# docs/index.html
# server/cmd/server/main.go
|
2026-07-11 16:44:05 +08:00 |
|
wangjia
|
05922710b2
|
feat(server): CORS 中间件(白名单跨域,支持用户中心/官网前端)
控制面无 CORS 导致 pangolin.yanmeiai.com 的用户中心跨域打 api.yanmeiai.com 被浏览器拦(Network error)。
加白名单 CORS(env CORS_ALLOWED_ORIGINS,默认 https://pangolin.yanmeiai.com):回显 Origin、应答预检 OPTIONS、
放行 Authorization/Content-Type;不用 '*'、不放行 credentials(走 Bearer token)。
|
2026-07-11 15:33:07 +08:00 |
|
wangjia
|
1a7b93ed2f
|
feat(server): /buy 自包含购买页(同源,USDT+哪吒,登录→下单→轮询开通)
单文件 HTML(内联 CSS+JS,go:embed)挂在公开 GET /buy,与 /v1/pay 同源免 CORS:
登录 -> 拉取套餐 -> 选 USDT/哪吒下单 -> 按 render_type(crypto_address/redirect/qr)
展示付款信息 -> 轮询订单直到 activated,页面隐藏/关闭时停止轮询。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-11 14:52:21 +08:00 |
|
wangjia
|
1198ecc556
|
fix(migrations): 恢复线性迁移编号,与生产已应用的对齐
集成分支曾把已上线的 000020_ad_bonus_minutes(#21)/000021_devices_user_scoped_uuid(#27)
两个迁移错误覆盖成 codes_lib_legacy_rename/pay_purchases,与生产(schema_migrations=21)
的实际血统冲突,导致 golang-migrate 在生产上找不到 version 21 文件而报错。
恢复为:020 ad_bonus / 021 devices / 022 codes_lib_legacy_rename / 023 pay_purchases。
生产库副本完整试跑通过:version→23,pay_purchases 建好,subscriptions CHECK 加 'pay',
codes 库表就位,3 用户/3 订阅数据零丢失。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-11 14:25:09 +08:00 |
|
wangjia
|
e6897ecda4
|
build(server): codes 依赖改伪版本 pin(经 gitea),去本地路径 replace
replace github.com/wangjia/codes => 本地路径 换成
require github.com/wangjia/codes v0.0.0-20260710045055-c772d5256794(gitea @ c772d52)。
本地/CI 需配 GOPRIVATE=github.com/wangjia/codes + git insteadOf(github→gitea ssh)。
交叉编译 linux/amd64 已验证:部署走本地编译+传二进制,目标机无需 go/gitea。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-11 09:21:53 +08:00 |
|
wangjia
|
bc9aa38392
|
fix(server): pay webhook 兜底补行不再漏停用用户(修静默丢钱)+ 未知事件日志 + PAY_BIZ_SECRET 启动守卫
- webhook 兜底路径(台账缺行按 biz_ref 定位用户)去掉 status='active' 过滤,
与正常路径(row.UserID 直接开通不看状态)对齐:钱已实收,不因用户被停用
(banned)而拒绝补行开通,避免 500→pay 12 次重投后死信→静默丢钱。
- 未知 event_type 分支加 slog.Warn,便于将来 pay 侧误注册无 handler 的事件
类型时能被观测到。
- PAY_BASE_URL 已设但 PAY_BIZ_SECRET 为空时 log.Fatal 拒绝启动,避免出站
签名失败+入站验签全 401 的静默瘫痪。
- InsertFromWebhookTx 不再把 channel 冒充 method 写入台账(payload 无 method
字段可复原,留空并加注释,消除台账观感误导)。
新增 TestWebhook_MissingLedgerFallsBackEvenWhenUserSuspended 覆盖 #1:
台账缺行 + 目标用户 banned 时,兜底补行仍成功开通并回 SUCCESS。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-11 00:48:57 +08:00 |
|
wangjia
|
390b8b8f84
|
chore(server): pay v2 接入终验 + OpenAPI 登记 + 交付说明
全量矩阵本地全绿(build/vet/test/run_sqlite_test.sh + 新增 SQLite 文件库带数据
升级彩排 + MySQL 8 容器验证 000021 MODIFY ENUM;client analyze/test 功能全绿,
27 个既有 golden 像素噪声与本次接入无关)。server/api/openapi.yaml 登记 6 个新
Pay 端点(catalog/orders/orderNo/retry/cancel/webhook)+ schema,通过结构校验。
顺手修复 run_mysql_test.sh 缺 multiStatements=true 的既有 bug(与 pay-v2 无关)。
新增 pay_migration_rehearsal_test.go 验证 000021 升级不丢行/AUTOINCREMENT 续序,
并确认一处安全特性:已有 source='pay' 行后 down 会被 CHECK 约束正确拒绝。
交付说明 docs/pay-v2-integration-delivery.html(含测试矩阵/联调 checklist/部署
附录)已登记 docs/index.html,记录一处既有但未修的部署前置阻断项(go.mod 的
wangjia/codes 本地路径 replace 会阻断异机构建,超出本任务授权范围)。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-11 00:34:10 +08:00 |
|
wangjia
|
16b8823f1f
|
feat(server): pay webhook 接收器(验签/时间窗/nonce + out_trade_no 幂等开通,回 SUCCESS)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 22:38:01 +08:00 |
|
wangjia
|
932953bafe
|
feat(server): /v1/pay 下单代理端点 + 购买台账(JWT 鉴权,user→biz_ref 映射)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 22:32:43 +08:00 |
|
wangjia
|
db2461ed1d
|
feat(server): pay v2 出站客户端(HMAC 签名下单/查单/retry/cancel)
|
2026-07-10 20:52:33 +08:00 |
|
wangjia
|
7370b17bd9
|
feat(server): codes.GrantPaidSubscriptionTx 提炼订阅叠加语义供 pay 复用
CreateSubscription/applySubscription 加 source 参数(兑换路径传 "code"
零行为变化);新导出 GrantPaidSubscriptionTx(ctx, tx, ...) 供 pay 侧在
调用方事务内以 source='pay' 复用同一段叠加语义(同 plan 活跃订阅原地
延长,否则新建行),写 pay_grant 审计。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 20:49:25 +08:00 |
|
wangjia
|
85140edf1c
|
feat(server): 迁移 000021 pay_purchases 台账 + subscriptions.source 扩 pay
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 20:46:13 +08:00 |
|
wangjia
|
16855a533a
|
chore(server): 清理 stale code_batches 注释
|
2026-07-10 15:03:45 +08:00 |
|
wangjia
|
db3428f622
|
test(server): mysql 集成测试对齐 codes 库新表(断言不变,环境搭建换 ApplyMigrations)(#codes-lib)
|
2026-07-10 15:03:43 +08:00 |
|
wangjia
|
ef4ed47759
|
feat(server): admin 批次列表/作废改指 codes 库新表,清理被取代的旧 store 方法(#codes-lib)
|
2026-07-10 14:53:29 +08:00 |
|
wangjia
|
d1e2fed563
|
feat(server): webhook 薄壳化——保留 X-Pangolin HMAC 协议,铸码走库单事务原语(#codes-lib)
|
2026-07-10 14:45:08 +08:00 |
|
wangjia
|
0822d22e2c
|
feat(server): Redeem 换芯 GuardedRedeem——grant 回调同事务复刻订阅叠加+双审计(#codes-lib)
|
2026-07-10 14:34:30 +08:00 |
|
wangjia
|
e128c96d22
|
feat(server): CreateBatch/生成器切换到 codes 库(Mint 单事务全成或全无)(#codes-lib)
Store 挂库 store(NewStore 内部构造 libcodes.Store,签名不变);
generator.go 三函数委托 libcodes,ErrDuplicate 别名同一哨兵;
Service.CreateBatch 走 libcodes.Mint(签名不变)。openMigratedSQLite
挪到共享 sqlite_helper_test.go,backfill_test.go/service_sqlite_test.go
共用。Store.CreateBatch/CreateCode/CodeExistsByHash 原样保留供
webhook.go(Task 6 改用新原语,Task 7 删除)。
|
2026-07-10 14:24:18 +08:00 |
|