shaw
aa8ee33b0a
refactor(affiliate): tighten DI and harden inviter code validation
...
- Drop SetAffiliateService setters and ProvideAuthService /
ProvidePaymentService / ProvideUserHandler wrappers in favor of direct
Wire constructor injection. AffiliateService has no back-edge to
Auth/Payment/User, so the indirection was never required.
- Change RegisterWithVerification's variadic affiliateCode to a fixed
parameter; adjust all call sites.
- Validate aff_code length and charset in BindInviterByCode before any
DB lookup, eliminating timing-side-channel and useless DB roundtrips
on malformed input.
- Make affiliate cache invalidation synchronous; surface Redis errors
via the project logger instead of swallowing them in a detached
goroutine.
- Add an integration test guarding cross-layer tx propagation in
AccrueQuota and a unit test pinning the aff_code format rules.
2026-04-25 08:44:18 +08:00
..
2026-04-09 18:14:28 +08:00
2026-04-09 18:14:28 +08:00
2026-04-23 21:40:58 +08:00
2026-02-02 22:13:50 +08:00
2026-04-25 08:44:18 +08:00
2026-04-24 22:22:26 +08:00
2026-03-03 16:11:05 +08:00
2026-04-21 10:13:28 -07:00
2026-04-09 18:14:28 +08:00
2026-04-09 18:14:28 +08:00
2026-01-03 06:37:08 -08:00
2026-01-03 06:37:08 -08:00
2026-02-02 22:13:50 +08:00
2026-04-10 18:13:18 +08:00
2026-02-22 22:07:17 +08:00
2026-04-10 18:13:18 +08:00
2026-04-09 18:14:28 +08:00
2026-04-23 16:34:37 +08:00
2026-04-22 18:36:44 +08:00
2026-04-22 14:56:56 +08:00
2026-03-14 17:48:21 +08:00
2026-03-16 20:22:10 +08:00
2026-02-07 19:46:42 +08:00
2026-02-08 12:05:39 +08:00
2026-02-07 19:46:42 +08:00
2026-03-16 13:39:50 +08:00
2026-04-21 15:24:48 +08:00
2026-04-21 14:39:19 +08:00
2026-04-14 09:35:20 +08:00
2026-04-04 11:13:58 +08:00
2026-04-09 18:14:28 +08:00
2026-04-14 18:34:57 +08:00
2026-03-02 16:04:20 +08:00
2026-03-26 11:17:25 +08:00
2026-03-02 16:04:20 +08:00
2026-03-27 14:33:05 +08:00
2026-01-01 04:01:51 +08:00
2026-03-09 19:55:18 +08:00
2026-03-09 19:55:18 +08:00
2026-04-15 15:02:21 +08:00
2026-01-11 15:00:16 +08:00
2026-01-11 15:00:16 +08:00
2025-12-31 23:42:01 +08:00
2025-12-31 23:42:01 +08:00
2025-12-25 17:15:01 +08:00
2025-12-26 16:47:44 +08:00
2026-04-14 09:35:20 +08:00
2026-03-07 18:19:04 +08:00
2026-02-05 21:52:54 +08:00
2026-02-10 11:42:39 +08:00
2025-12-31 23:42:01 +08:00
2026-03-12 17:42:41 +08:00
2026-02-28 15:01:20 +08:00
2026-04-23 21:40:58 +08:00
2026-02-02 22:13:50 +08:00
2026-02-26 10:53:04 +08:00
2026-03-02 16:04:20 +08:00
2026-01-14 15:55:44 +08:00
2026-01-14 15:55:44 +08:00
2026-01-15 18:27:06 +08:00
2026-03-02 16:04:20 +08:00
2026-01-07 23:15:20 +08:00
2026-03-02 16:04:20 +08:00
2026-04-10 18:13:18 +08:00
2026-04-09 19:25:08 +08:00
2026-04-23 16:34:37 +08:00
2026-03-02 16:04:20 +08:00
2026-03-02 16:04:20 +08:00
2026-03-27 14:33:05 +08:00
2026-02-28 15:01:20 +08:00
2026-02-23 12:45:37 +08:00
2025-12-25 17:15:01 +08:00
2025-12-26 16:47:44 +08:00
2026-03-02 01:12:41 +08:00
2026-01-03 06:36:35 -08:00
2026-04-08 10:39:15 -07:00
2026-03-27 20:11:24 +08:00
2026-04-22 18:01:51 +08:00
2026-04-22 18:01:51 +08:00
2026-04-22 14:56:56 +08:00
2026-04-22 18:01:51 +08:00
2026-04-22 14:56:56 +08:00
2026-04-23 12:58:13 +08:00
2026-04-23 12:23:04 +08:00
2026-04-23 12:23:04 +08:00
2026-01-15 15:14:44 +08:00
2026-02-28 15:01:20 +08:00
2026-02-28 15:01:20 +08:00
2026-02-14 11:21:30 +08:00
2026-01-11 23:49:03 +08:00
2026-01-09 20:52:57 +08:00
2026-03-03 01:05:11 +08:00
2026-01-23 19:39:48 +08:00
2026-02-12 14:20:14 +08:00
2026-02-12 14:20:14 +08:00
2026-01-13 22:49:26 -08:00
2026-01-12 14:17:42 +08:00
2026-01-11 23:57:20 +08:00
2026-02-12 16:27:29 +08:00
2026-01-24 01:14:44 +08:00
2026-01-09 20:52:57 +08:00
2026-03-21 23:38:00 +08:00
2026-03-11 17:40:28 +08:00
2026-04-09 18:14:28 +08:00
2026-03-02 16:04:20 +08:00
2026-03-02 16:04:20 +08:00
2026-04-09 19:25:08 +08:00
2026-01-15 15:14:44 +08:00
2026-02-03 17:12:27 +08:00
2026-03-19 23:48:37 +08:00
2025-12-29 19:23:49 +08:00
2026-04-09 18:14:28 +08:00
2026-04-09 21:49:10 +08:00
2025-12-26 16:47:44 +08:00
2025-12-26 16:47:44 +08:00
2025-12-26 16:47:44 +08:00
2025-12-29 19:23:49 +08:00
2026-04-09 18:14:28 +08:00
2026-04-09 21:49:10 +08:00
2026-02-02 22:13:50 +08:00
2026-02-02 22:13:50 +08:00
2026-02-05 12:42:54 +08:00
2026-03-02 16:04:20 +08:00
2026-03-12 21:24:01 +08:00
2026-02-28 20:38:35 +08:00
2026-03-08 06:59:53 +08:00
2026-04-08 10:39:15 -07:00
2026-04-16 02:01:50 +00:00
2026-04-16 02:01:50 +00:00
2026-03-11 17:32:00 +08:00
2026-02-02 22:13:50 +08:00
2026-02-12 12:07:20 +08:00
2026-02-12 12:04:13 +08:00
2026-02-05 22:36:17 +08:00
2026-03-04 10:15:42 +08:00
2025-12-29 10:03:27 +08:00
2026-03-07 18:19:04 +08:00
2026-02-02 22:13:50 +08:00
2026-02-02 22:13:50 +08:00
2026-03-03 16:11:05 +08:00
2025-12-30 17:13:32 +08:00
2026-01-03 06:34:00 -08:00
2026-01-11 21:54:52 -08:00
2026-03-27 14:33:05 +08:00
2026-03-27 14:33:05 +08:00
2026-02-02 22:13:50 +08:00
2026-01-03 06:36:35 -08:00
2026-01-03 10:52:24 +08:00
2025-12-25 16:01:17 +08:00
2025-12-25 17:15:01 +08:00
2026-04-23 14:53:57 +08:00
2026-04-23 14:53:57 +08:00
2026-02-02 22:13:50 +08:00
2026-02-28 15:01:20 +08:00
2026-02-28 15:01:20 +08:00
2026-03-21 01:23:20 +08:00
2026-04-15 15:02:21 +08:00
2026-04-15 15:02:21 +08:00
2026-04-09 18:14:28 +08:00
2026-03-12 18:38:09 +08:00
2026-04-23 21:40:58 +08:00
2026-01-01 19:09:06 +08:00
2026-04-23 16:34:37 +08:00
2026-03-03 01:05:11 +08:00
2026-04-22 13:22:33 +08:00
2026-04-22 14:56:56 +08:00
2026-04-22 14:56:56 +08:00
2026-04-21 00:13:40 +08:00
2026-04-22 16:38:36 +08:00
2026-04-21 10:13:28 -07:00
2026-04-22 02:42:43 +08:00
2026-04-23 16:34:37 +08:00
2026-04-23 16:34:37 +08:00
2026-03-18 10:35:03 +08:00
2026-03-18 09:23:19 +08:00
2026-04-24 22:22:26 +08:00