1. 02 Feb, 2026 1 commit
  2. 05 Jan, 2026 1 commit
    • longgexx's avatar
      fix(billing): 修复计费漏洞 · d6f8ac02
      longgexx authored
          - 允许余额透支策略
      
         ## 问题
         - 扣费失败时只记录日志,不阻止请求完成
         - 用户可以用极少余额无限次免费使用服务
         - 数据库层使用 BalanceGTE 条件防止余额变负,导致余额不足时扣费失败
      
         ## 修复
         - 移除 DeductBalance 方法中的 BalanceGTE 条件,允许余额变为负数
         - 修改错误返回:用户不存在时返回 ErrUserNotFound
         - 实现透支策略:余额不足时允许本次请求完成,余额变负后阻止后续请求
      
         ## 测试
         - 更新 TestDeductBalance_InsufficientFunds 测试,验证透支功能
         - 更新 TestDeductBalance_NotFound 测试,验证正确的错误类型
         - 新增 TestDeductBalance_AllowsOverdraft 测试,专门测试透支场景
         - 所有测试通过 
      d6f8ac02
  3. 03 Jan, 2026 2 commits
    • ianshaw's avatar
      fix(lint): 修复 golangci-lint 检查问题 · 519b0b24
      ianshaw authored
      - 格式化代码 (gofmt)
      - 修复 rows.Close() 返回值未检查 (errcheck)
      - 删除未使用的 usage_clamp.go 文件 (unused)
      - 删除临时测试目录
      519b0b24
    • ianshaw's avatar
      chore: 更新依赖、配置和代码生成 · 112a2d08
      ianshaw authored
      主要更新:
      - 更新 go.mod/go.sum 依赖
      - 重新生成 Ent ORM 代码
      - 更新 Wire 依赖注入配置
      - 添加 docker-compose.override.yml 到 .gitignore
      - 更新 README 文档(Simple Mode 说明和已知问题)
      - 清理调试日志
      - 其他代码优化和格式修复
      112a2d08
  4. 01 Jan, 2026 1 commit
    • Edric Li's avatar
      refactor: migrate wechat to user attributes and enhance users list · 404bf0f8
      Edric Li authored
      Migrate the hardcoded wechat field to the new extensible user
      attributes system and improve the users management UI.
      
      Migration:
      - Add migration 019 to move wechat data to user_attribute_values
      - Remove wechat field from User entity, DTOs, and API contracts
      - Clean up wechat-related code from backend and frontend
      
      UsersView enhancements:
      - Add text labels to action buttons (Filter Settings, Column Settings,
        Attributes Config) for better UX
      - Change status column to show colored dot + Chinese text instead of
        English text
      - Add dynamic attribute columns support with batch loading
      - Add column visibility settings with localStorage persistence
      - Add filter settings modal for search and filter preferences
      - Update i18n translations
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      404bf0f8
  5. 31 Dec, 2025 2 commits
    • yangjianbo's avatar
      fix(lint): 修复 golangci-lint 报告的代码问题 · 682f546c
      yangjianbo authored
      - errcheck: 修复类型断言未检查返回值的问题
        - pool.go: 添加 sync.Map 类型断言安全检查
        - req_client_pool.go: 添加 sync.Map 类型断言安全检查
        - concurrency_cache_benchmark_test.go: 显式忽略断言返回值
        - gateway_service.go: 显式忽略 WriteString 返回值
      
      - gofmt: 修复代码格式问题
        - redis.go: 注释对齐
        - api_key_repo.go: 结构体字段对齐
        - concurrency_cache.go: 字段对齐
        - http_upstream.go: 注释对齐
      
      - unused: 删除未使用的代码
        - user_repo.go: 删除未使用的 sql 字段
        - usage_service.go: 删除未使用的 calculateStats 函数
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      682f546c
    • yangjianbo's avatar
      fix(数据层): 修复数据完整性与仓储一致性问题 · 5906f9ab
      yangjianbo authored
      ## 数据完整性修复 (fix-critical-data-integrity)
      - 添加 error_translate.go 统一错误转换层
      - 修复 nil 输入和 NotFound 错误处理
      - 增强仓储层错误一致性
      
      ## 仓储一致性修复 (fix-high-repository-consistency)
      - Group schema 添加 default_validity_days 字段
      - Account schema 添加 proxy edge 关联
      - 新增 UsageLog ent schema 定义
      - 修复 UpdateBalance/UpdateConcurrency 受影响行数校验
      
      ## 数据卫生修复 (fix-medium-data-hygiene)
      - UserSubscription 添加软删除支持 (SoftDeleteMixin)
      - RedeemCode/Setting 添加硬删除策略文档
      - account_groups/user_allowed_groups 的 created_at 声明 timestamptz
      - 停止写入 legacy users.allowed_groups 列
      - 新增迁移: 011-014 (索引优化、软删除、孤立数据审计、列清理)
      
      ## 测试补充
      - 添加 UserSubscription 软删除测试
      - 添加迁移回归测试
      - 添加 NotFound 错误测试
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      5906f9ab
  6. 30 Dec, 2025 1 commit
    • yangjianbo's avatar
      fix(仓储): 修复查询关闭错误并迁移集成测试 · aacbc98a
      yangjianbo authored
      修复 rows.Close 失败时的错误返回逻辑
      迁移网关路由集成测试到 ent 事务基建
      补齐仓储接口变更对应的测试桩方法
      新增 backend/Makefile 统一测试命令
      测试: GOTOOLCHAIN=go1.24.11 go test ./...
      测试: golangci-lint run ./... --timeout=5m
      测试: make test-integration
      aacbc98a
  7. 29 Dec, 2025 5 commits
    • Junming Chen's avatar
      19d0ee13
    • yangjianbo's avatar
      fix(仓储): 修复软删除过滤与事务测试 · ae191f72
      yangjianbo authored
      修复软删除拦截器使用错误,确保默认查询过滤已删记录
      仓储层改用 ent.Tx 与扫描辅助,避免 sql.Tx 断言问题
      同步更新集成测试以覆盖事务与统计变动
      ae191f72
    • yangjianbo's avatar
      fix(用户): 修复删除用户软删除钩子 · 4dab18a9
      yangjianbo authored
      避免软删除钩子类型断言失败导致 500\n删除无记录时返回未找到错误并记录日志
      4dab18a9
    • yangjianbo's avatar
      fix(仓储层): 修复事务 ent client 调用 Close() 导致的 panic · 5584709a
      yangjianbo authored
      问题:创建用户时发生 panic,错误信息为
      "interface conversion: sql.ExecQuerier is *sql.Tx, not *sql.DB"
      
      原因:基于事务创建的 ent client 在调用 Close() 时,ent 的 sql driver
      会尝试将 ExecQuerier 断言为 *sql.DB 来关闭连接,但实际类型是 *sql.Tx
      
      修复:移除对 txClient.Close() 的调用,事务的清理通过
      sqlTx.Rollback() 和 sqlTx.Commit() 完成即可
      
      影响范围:
      - user_repo.go: Create 和 Update 方法
      - group_repo.go: Delete 方法
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      5584709a
    • yangjianbo's avatar
      refactor(数据库): 迁移持久层到 Ent 并清理 GORM · 3d617de5
      yangjianbo authored
      将仓储层/基础设施改为 Ent + 原生 SQL 执行路径,并移除 AutoMigrate 与 GORM 依赖。
      重构内容包括:
      - 仓储层改用 Ent/SQL(含 usage_log/account 等复杂查询),统一错误映射
      - 基础设施与 setup 初始化切换为 Ent + SQL migrations
      - 集成测试与 fixtures 迁移到 Ent 事务模型
      - 清理遗留 GORM 模型/依赖,补充迁移与文档说明
      - 增加根目录 Makefile 便于前后端编译
      
      测试:
      - go test -tags unit ./...
      - go test -tags integration ./...
      3d617de5
  8. 26 Dec, 2025 1 commit
  9. 25 Dec, 2025 1 commit
  10. 24 Dec, 2025 1 commit
  11. 23 Dec, 2025 2 commits
    • dexcoder6's avatar
      feat: 增强用户管理功能,添加用户名、微信号和备注字段 · 0b8e84f9
      dexcoder6 authored
      - 新增User模型字段:username(用户名)、wechat(微信号)、notes(备注)
      - 扩展用户搜索功能,支持通过用户名和微信号搜索
      - 添加用户个人资料更新功能,用户可自行编辑用户名和微信号
      - 管理员用户列表新增用户名、微信号、备注显示列
      - 备注字段仅对管理员可见,增强数据安全性
      - 完善中英文国际化翻译
      - 修复国际化文件中重复属性的TypeScript错误
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Sonnet 4.5 <noreply@anthropic.com>
      0b8e84f9
    • shaw's avatar
      feat: 用户列表显示订阅分组及剩余天数 · f0fabf89
      shaw authored
      - User模型新增Subscriptions关联
      - 用户列表批量加载订阅信息避免N+1查询
      - GroupBadge组件支持显示剩余天数(过期红色、<=3天红色、<=7天橙色)
      - 用户管理页面新增订阅分组列
      f0fabf89
  12. 20 Dec, 2025 1 commit
  13. 19 Dec, 2025 1 commit
  14. 18 Dec, 2025 1 commit