shanshanzhong147
ac25eb4d91
修复( #140 ): 去掉 cancelWithdrawalLogic 在新流程下的重复退款
...
Build docker and publish / build (20.15.1) (push) Has been cancelled
Build docker and publish / build (20.15.1) (pull_request) Has been cancelled
Squash merge of fix/140-去掉撤销提现的重复退款 (86896cd ).
HIF-22 引入 rejectWithdrawal 反查支付网关后,cancelWithdrawalLogic 仍在
事务体内调用 UpdateCommission(+amount),对已在 rejectWithdrawal 中退还
的金额做了二次退款。本次只保留 withdrawal.status -> Cancelled,与
rejectWithdrawal 行为对齐。
新增 cancelWithdrawalLogic_test.go 用 sqlmock 严格断言:撤销 happy path
只触发 BEGIN / SELECT FOR UPDATE / UPDATE withdrawals / COMMIT 四条 SQL,
对 user / system_logs 零读零写。
Co-authored-by: multica-agent <github@multica.ai >
2026-06-02 20:23:45 -07:00
shanshanzhong147
0659a930f8
修复( #128 ): 修复家庭成员邀请流水可见性
...
Build docker and publish / build (20.15.1) (push) Failing after 18m41s
Build docker and publish / build (20.15.1) (pull_request) Failing after 19m16s
Co-authored-by: multica-agent <github@multica.ai >
2026-05-30 03:27:04 -07:00
shanshanzhong147
e5d6539d79
修复( #126 ): 修复家庭组邀请记录漏查验收分支
...
Build docker and publish / build (20.15.1) (push) Failing after 20m3s
Build docker and publish / build (20.15.1) (pull_request) Failing after 21m10s
Co-authored-by: multica-agent <github@multica.ai >
2026-05-29 20:35:37 -07:00
shanshanzhong147
3e265bd837
新功能: 还原 v1/public/user/invite_sales 接口 + promo schema 修复迁移
...
Build docker and publish / build (20.15.1) (push) Failing after 13m47s
Build docker and publish / build (20.15.1) (pull_request) Failing after 15m7s
- 还原 /v1/public/user/invite_sales 接口及 /invite/sales 别名(与 invite_records 并存)
逻辑/handler/types 与 197fed7d 删除前版本完全一致,按 fefbd4f5 新 routes 结构注册
- 新增迁移 02155_promo_schema_fix: 幂等修复 subscribe_promo / order 列类型与索引偏差
- 同步 etc/ppanel.yaml 数据库连接配置
- 补齐相关需求与设计文档
2026-05-28 20:46:37 -07:00
shanshanzhong147
197fed7d12
新功能( #102 ): 新增邀请记录接口并删除旧邀请销售接口
...
Build docker and publish / build (20.15.1) (push) Failing after 10m56s
Build docker and publish / build (20.15.1) (pull_request) Successful in 8m50s
Co-authored-by: multica-agent <github@multica.ai >
2026-05-27 22:50:16 -07:00
shanshanzhong147
b9192db042
feat: 文件上传接口直接返回完整 URL + 提现 content 改为非必填
...
Build docker and publish / build (20.15.1) (push) Failing after 8m29s
Build docker and publish / build (20.15.1) (pull_request) Successful in 8m3s
- FileUploadResponse / FileUploadCompleteResponse 精简为只返回 url
- S3Store.BuildObjectURL 拼接完整访问地址
- 提现 method=0 时 content 不再参与必填校验
- 新增用户端 API 接口文档
2026-05-27 00:57:21 -07:00
shanshanzhong147
92e303aaa7
修复( #80 ): 修复wrapf非常量格式串vet阻断
...
Build docker and publish / build (20.15.1) (push) Has been cancelled
Build docker and publish / build (20.15.1) (pull_request) Successful in 8m39s
Co-authored-by: multica-agent <github@multica.ai >
2026-05-26 22:18:26 -07:00
shanshanzhong147
f9fa4756e9
新功能( #41 ): 提现优化 — 收款方式选择 + 取消提现 + 收款码上传
...
Build docker and publish / build (20.15.1) (push) Failing after 8m37s
Co-authored-by: multica-agent <github@multica.ai >
2026-05-26 08:36:25 -07:00
shanshanzhong147
eba256bdc9
merge: sync internal with main
...
Build docker and publish / build (20.15.1) (push) Failing after 8m22s
Co-authored-by: multica-agent <github@multica.ai >
2026-05-25 10:32:06 -07:00
shanshanzhong147
80751eb8ef
fix: move withdrawal commission deduction from application to approval
...
Build docker and publish / build (20.15.1) (push) Failing after 8m28s
- commissionWithdrawLogic: remove upfront commission deduction;
balance check now includes sum of all pending withdrawals to prevent
double-spending; transaction only creates the withdrawal record (status=0)
- approveWithdrawal: add FOR UPDATE lock on user row, balance check before
deducting, atomic commission decrement and commission log inside one
transaction; clear user cache after commit
- rejectWithdrawal: remove commission refund and log — commission was never
deducted on application under the new flow
- add migration 02150: refund commission for existing status=0 withdrawals
that were deducted under the old logic; includes rollback script
Co-authored-by: multica-agent <github@multica.ai >
2026-05-24 20:26:42 -07:00
shanshanzhong147
fd522b6c71
path
Build docker and publish / build (20.15.1) (push) Successful in 8m56s
2026-05-19 19:35:44 -07:00
shanshanzhong147
a1184ef5ed
feat: add userinfo bind-email trial use status
Build docker and publish / build (20.15.1) (push) Successful in 9m2s
2026-05-18 03:02:35 -07:00
shanshanzhong147
f6911965dc
chore: snapshot current aws standby and backup tooling work
2026-05-13 10:59:03 -07:00
shanshanzhong147
c4b2ebf7e1
x
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-10 10:41:50 -07:00
shanshanzhong147
f946504cb8
x
2026-05-08 06:19:59 -07:00
shanshanzhong147
7d2f98b7c9
fix: 修复管理员更新用户信息时意外覆盖字段的问题
...
Build docker and publish / build (20.15.1) (push) Has been cancelled
- Enable/IsAdmin/OnlyFirstPurchase 改为 *bool,未传时不更新
- Avatar/Remark/ReferCode/ReferralPercentage 加空值保护
- getDeviceList: 恢复 hifastday@hifast.com 家庭成员受限逻辑
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-07 02:21:35 -07:00
shanshanzhong147
463d3e2315
x
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 03:19:04 -07:00
shanshanzhong147
559d59b4f8
000000
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 03:09:15 -07:00
shanshanzhong147
d4f0d559cf
设备1
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 02:53:18 -07:00
shanshanzhong147
cbb451d18c
x
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-06 02:34:43 -07:00
shanshanzhong147
110c97ada4
feat(auth): add test bypass code 202511 for bind_email_with_verification
...
Build docker and publish / build (20.15.1) (push) Failing after 5m30s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-02 08:00:39 -07:00
shanshanzhong147
d748a7e75d
fix(user): move bind-email subscriptions to owner
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-05-01 05:24:11 -07:00
shanshanzhong147
ab38cd4943
x
Build docker and publish / build (20.15.1) (push) Failing after 4m44s
2026-04-26 21:12:22 -07:00
shanshanzhong147
5b49aa8242
fix(auth): disable trial grants on public email flows
Build docker and publish / build (20.15.1) (push) Successful in 5m29s
2026-04-25 01:11:27 -07:00
shanshanzhong147
ae62ecc6b3
fix: 加入家庭组时无条件丢弃成员订阅,防止重复订阅
...
Build docker and publish / build (20.15.1) (push) Failing after 5m17s
加入家庭组前若成员已购买订阅,原逻辑将订阅转移给 owner,
导致 owner 同时持有自身订阅与成员转入订阅,违反单订阅模式。
修改 transferMemberSubscribesToOwner:
- 移除转移逻辑,改为无条件删除成员所有订阅
- 成员加入后通过 owner 的订阅使用服务
- 后续购买以 entitlement.EffectiveUserID(owner)为目标,不受影响
2026-04-22 09:24:00 -07:00
shanshanzhong147
954b19c332
feat: 邮箱规范化(NormalizeEmail)与域名白名单检查(IsEmailDomainWhitelisted)
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-04-12 18:43:47 -07:00
shanshanzhong147
e818ac8764
x
Build docker and publish / build (20.15.1) (push) Successful in 7m38s
2026-04-04 09:41:41 -07:00
shanshanzhong147
98d8525fa9
refactor: 简化 trial 赠送配置,删除多余的白名单启用开关
...
Build docker and publish / build (20.15.1) (push) Successful in 7m42s
**简化方案**:
- 删除 `EnableTrialEmailWhitelist` 配置字段(多余)
- 保留 `TrialEmailDomainWhitelist`(逗号分隔的白名单域名)
- 赠送规则:白名单**非空** 且 **邮箱在列表** 才赠送
**新的赠送逻辑**:
```yaml
TrialEmailDomainWhitelist: "qq.com,163.com,gmail.com"
```
- 为空 → ❌ 不赠送(关闭)
- 非空 → ✅ 赠送给白名单域名的邮箱
**更新的地方**:
1. internal/config/config.go - 删除 EnableTrialEmailWhitelist 字段
2. userRegisterLogic.go - 简化赠送逻辑
3. emailLoginLogic.go - 简化赠送逻辑
4. bindEmailWithVerificationLogic.go - 简化赠送逻辑
5. oAuthLoginGetTokenLogic.go - 简化赠送逻辑
**配置升级说明**:
旧配置:
```yaml
EnableTrial: true
EnableTrialEmailWhitelist: true
TrialEmailDomainWhitelist: "qq.com,163.com"
```
新配置(只保留两项):
```yaml
EnableTrial: true
TrialEmailDomainWhitelist: "qq.com,163.com"
```
关闭赠送:
```yaml
EnableTrial: true
TrialEmailDomainWhitelist: ""
```
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-04-03 07:20:10 -07:00
shanshanzhong147
19777df2ed
fix: bindEmailWithVerificationLogic 邮箱绑定后赠送逻辑错误
...
**问题**: 邮箱绑定后应该赠送 trial 的逻辑判断错误,导致以下场景无法赠送:
- EnableTrial=true, EnableTrialEmailWhitelist=false → 应该赠送但未赠送
**根本原因**: 第215行条件判断使用 OR 逻辑,要求白名单必须启用才处理
```go
if !rc.EnableTrial || !rc.EnableTrialEmailWhitelist {
return // ❌ 错误:关闭白名单时也返回,无法赠送
}
```
**修复**: 改为正确的逻辑
```go
if !rc.EnableTrial {
return // 关闭赠送时不处理
}
if rc.EnableTrialEmailWhitelist && !IsEmailDomainWhitelisted(...) {
return // 白名单启用但域名不匹配时不赠送
}
// 否则赠送
```
**影响场景**:
- 设备登录 → 绑定邮箱 → 应该赠送 trial
- 当 EnableTrialEmailWhitelist=false 时,应该赠送(修复前未赠送)
- 当 EnableTrialEmailWhitelist=true 且域名在白名单 → 赠送(修复前未赠送)
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-04-03 07:17:27 -07:00
shanshanzhong147
3417da2a9e
feat: trial 赠送改为白名单邮箱域名控制
...
Build docker and publish / build (20.15.1) (push) Failing after 7m14s
- 新增 EnableTrialEmailWhitelist + TrialEmailDomainWhitelist 配置
- 邮箱注册/登录:加白名单域名判断,域名匹配才赠送 trial
- 设备登录/手机注册:移除 activeTrial,不再自动赠送
- 绑定邮箱(bindEmailWithVerification):绑定成功后检查白名单+防重复赠送
- 新增 IsEmailDomainWhitelisted 导出函数供跨包调用
- 清理 deviceLoginLogic/telephoneUserRegisterLogic 中的 activeTrial 死代码
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-04-02 05:46:04 -07:00
shanshanzhong147
2362b67634
fix: QueryUserInfo 设备列表改为家庭范围查询,修复 email 用户 user_devices 为空的问题
Build docker and publish / build (20.15.1) (push) Failing after 7m43s
2026-03-31 17:07:09 -07:00
shanshanzhong147
e5e9f93f68
Merge remote-tracking branch 'origin/master' into internal
2026-03-19 01:55:01 -07:00
shanshanzhong147
282e1e4087
deviceno
Build docker and publish / build (20.15.1) (push) Successful in 7m26s
2026-03-17 09:12:56 -07:00
shanshanzhong147
dcdbabdb13
注销
Build docker and publish / build (20.15.1) (push) Successful in 7m34s
2026-03-17 07:12:42 -07:00
shanshanzhong147
79a1eeca1f
feat: 自动生成并更新用户缺失的推荐码
Build docker and publish / build (20.15.1) (push) Successful in 7m33s
2026-03-15 19:43:53 -07:00
shanshanzhong147
3d732c0361
feat: 为用户设备添加 DeviceNo 字段并实现 ID 混淆,同时在迁移脚本中新增 ID 重建逻辑。
Build docker and publish / build (20.15.1) (push) Has been cancelled
2026-03-15 19:38:37 -07:00
EUForest
06a2425474
feat(subscribe): add traffic limit rules and user traffic stats
...
- Add subscribe traffic_limit schema and migration\n- Support traffic_limit in admin create/update and list/details\n- Apply traffic_limit when building server user list speed limits\n- Add public user traffic stats API
2026-03-14 12:41:52 +08:00
shanshanzhong147
2cc1124dd8
fix: 任何人注销账号都解散整个家庭组,删除所有成员的登录方式和订阅
...
Build docker and publish / build (20.15.1) (push) Successful in 7m41s
统一 member/owner 注销逻辑:无论谁注销,都解散家庭、
删除所有成员的 AuthMethods + Subscribe、踢出所有设备、清除所有缓存。
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-12 06:23:11 -07:00
shanshanzhong147
2f33e1e680
fix: 踢其他设备时不再清除踢人者自己的 session
...
Build docker and publish / build (20.15.1) (push) Successful in 7m29s
logoutUnbind 循环清理家庭成员时,踢人者(kicker)也在成员列表中,
导致 kicker 的设备被踢、session 被清,自己也下线了。
现在跳过 kickerUserID,只清缓存不踢设备不清 session。
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-12 03:05:34 -07:00
shanshanzhong147
e4ec85c176
fix: clearAllSessions 改用 SCAN 查找 session,修复会话清理无效
...
Build docker and publish / build (20.15.1) (push) Successful in 7m37s
根因:登录时只写了 auth:session_id:{sessionId} (Redis SET),
从未写入 auth:user_sessions:{userId} sorted set,
导致 clearAllSessions 用 ZRange 永远返回空,session 根本没被清除。
修复:改用 SCAN auth:session_id:* 遍历所有 session key,
按 value 匹配 userId 找出该用户的全部 session 后删除,
同时清理关联的 device cache key。
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-12 02:47:32 -07:00
shanshanzhong147
dddb8c7fe2
fix: 平级踢人后更新被踢设备 online 状态为 false
...
Build docker and publish / build (20.15.1) (push) Has been cancelled
unbindDeviceLogic.logoutUnbind 中 KickDevice 后缺少
device.Online = false + UpdateDevice,导致后台仍显示在线
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-12 02:37:12 -07:00
shanshanzhong147
384c8df506
fix: 踢出用户时清除所有 session,确保旧 token 立即失效
...
Build docker and publish / build (20.15.1) (push) Successful in 7m43s
- kickOfflineByUserDeviceLogic: 管理员踢设备后新增 clearAllSessions,
之前只清单个 WebSocket session,用户可用旧 token 继续访问
- unbindDeviceLogic: 家庭成员被踢时增加踢设备+清 session;
补全 session detail key 清理
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-12 02:19:35 -07:00
shanshanzhong147
7d5b4fcb84
邮箱修复
Build docker and publish / build (20.15.1) (push) Successful in 7m13s
2026-03-12 01:24:21 -07:00
shanshanzhong147
a3cc23bbd4
feat: 绑定新邮箱时创建独立邮箱用户并转移订阅,而非挂在设备用户上
...
Build docker and publish / build (20.15.1) (push) Successful in 8m5s
- bindEmailWithVerificationLogic: 新邮箱路径改为创建独立 email user + joinFamily
- familyBindingHelper: clearMemberSubscribes → transferMemberSubscribesToOwner,订阅转移给 owner 而非删除
- accountMergeHelper: 同步更新调用点
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-12 00:52:50 -07:00
shanshanzhong147
3f56fc6def
feat: Owner 退出登录时转移订阅/邮箱/家庭权限给 member,而非解散家庭
...
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
Co-Authored-By: claude-flow <ruv@ruv.net >
2026-03-11 09:00:35 -07:00
shanshanzhong147
26f6400e74
feat: 苹果支付uuid 及设备逻辑
Build docker and publish / build (20.15.1) (push) Successful in 8m3s
2026-03-10 19:53:19 -07:00
shanshanzhong147
a542a6df46
fix: 修复 退出登录 auth问题
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
2026-03-09 09:04:47 -07:00
shanshanzhong147
b303f16525
fix: 退出登录不删除用户订阅,保留订阅数据
Build docker and publish / build (20.15.1) (push) Successful in 7m52s
2026-03-09 01:48:54 -07:00
shanshanzhong147
9c197442a6
fix: 退出登录时删除用户订阅并清理订阅缓存
...
Build docker and publish / build (20.15.1) (push) Successful in 7m45s
- 事务内删除用户所有订阅记录
- 事务后清理订阅缓存、套餐缓存、节点缓存
2026-03-09 01:31:04 -07:00
shanshanzhong147
d6437f043f
fix: 退出登录时解绑邮箱和家庭组,清除所有session
...
Build docker and publish / build (20.15.1) (push) Successful in 7m54s
- logoutUnbind 新增删除非 device 类型的 auth_methods(解绑邮箱)
- 清除用户所有 session 而非仅当前 session
- 事务前收集家庭成员 ID,事务后清理成员缓存
- 清理邮箱相关 Redis 缓存
2026-03-09 01:12:38 -07:00