Merge branch 'main' into test

冲突解决:
- wire_gen.go: 合并 antigravityGatewayService 和 ProvideConcurrencyCache
- user_repo_integration_test.go: 保留 NotFound 测试
- antigravity_gateway_service.go: 适配 httpUpstream.Do 新签名

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
yangjianbo
2025-12-31 14:17:18 +08:00
19 changed files with 441 additions and 141 deletions

View File

@@ -356,7 +356,7 @@ func (r *accountRepository) BatchUpdateLastUsed(ctx context.Context, updates map
idx := 1
for id, ts := range updates {
caseSQL += " WHEN $" + itoa(idx) + " THEN $" + itoa(idx+1)
caseSQL += " WHEN $" + itoa(idx) + " THEN $" + itoa(idx+1) + "::timestamptz"
args = append(args, id, ts)
ids = append(ids, id)
idx += 2

View File

@@ -390,4 +390,3 @@ func mustBindAccountToGroup(t *testing.T, client *dbent.Client, accountID, group
Save(ctx)
require.NoError(t, err, "create account_group")
}

View File

@@ -76,8 +76,8 @@ func (s *UserRepoSuite) mustCreateSubscription(userID, groupID int64, mutate fun
create := s.client.UserSubscription.Create().
SetUserID(userID).
SetGroupID(groupID).
SetStartsAt(now.Add(-1*time.Hour)).
SetExpiresAt(now.Add(24*time.Hour)).
SetStartsAt(now.Add(-1 * time.Hour)).
SetExpiresAt(now.Add(24 * time.Hour)).
SetStatus(service.SubscriptionStatusActive).
SetAssignedAt(now).
SetNotes("")
@@ -528,4 +528,3 @@ func (s *UserRepoSuite) TestDeductBalance_NotFound() {
// DeductBalance 在用户不存在时返回 ErrInsufficientBalance 因为 WHERE 条件不匹配
s.Require().ErrorIs(err, service.ErrInsufficientBalance)
}