feat: 福利钱包+签到+省钱战绩+激励广告发奖+微信提现 后端 #2
Reference in New Issue
Block a user
Delete Branch "feature/welfare-withdraw-ad"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
按 docs/api 一接口一文件约定新增: - 钱包(11): account / coin-transactions / cash-transactions / exchange-info / exchange / bind-wechat / unbind-wechat / withdraw-info / withdraw / withdraw/status / withdraw-orders - 签到(2): status / 执行签到 - 任务(2): list / {task_key}/claim - 省钱(3): summary / battle / records - 看广告发奖(3): pangle-callback(S2S验签) / reward-status / test-grant(仅联调) - README 索引补 12–32 行 + 新增「游标分页约定」+ 修正鉴权说明 + 注明金额以分为单位 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>- 验签: pangle.build_sign/verify_callback_sign 改为 GroMore 官方 sign=SHA256("{m-key}:{trans_id}")(普通 SHA256,只签 trans_id); 回调响应改成 GroMore 要求的 {is_verify, reason} - 发奖: 按回调 reward_amount 发金币(rewards 带回退/夹紧),ad_reward 幂等 + 每日上限 - 分层: app/core/{pangle,wxpay}.py → app/integrations/(对齐 jiguang/meituan/sms); 更新 ad.py / crud/wallet.py / scripts/sim_pangle_callback.py / 测试的 import (含 test_withdraw 的 monkeypatch 路径 app.core.wxpay→app.integrations.wxpay) - 测试: test_ad_reward + test_withdraw 共 17 项通过 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>- 数据访问层统一: app/crud/{ad_reward,savings,signin,task,wallet}.py 移入 app/repositories/(与 user.py 同目录),删除 crud/;更新 10 处 import (api/v1/* + scripts/* + repositories 内部交叉引用 app.crud→app.repositories) - alembic/versions 9 个迁移文件去掉 hex 前缀,改成可读文件名(如 welfare_tables_coin_account_coin_txn.py);**仅重命名文件**,文件内 revision/down_revision 不动 → 迁移链与已迁移库的 alembic_version 不受影响 (alembic heads/history 验证链完好,单一 head c8d9e0f1a2b3) - 测试: 37 passed(1 个 coupon 代理失败为连不到 pricebot 上游的环境问题,与本次无关) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>