1. 29 Dec, 2025 4 commits
    • yangjianbo's avatar
      fix(仓储): 修复 ApiKey 更新并发语义 · 042d8235
      yangjianbo authored
      ApiKey 更新时显式设置 updated_at 并回填,避免二次查询竞态
      补充软删除范围注释以统一审计语义
      042d8235
    • yangjianbo's avatar
      fix(仓储): 修复软删除过滤与事务测试 · ae191f72
      yangjianbo authored
      修复软删除拦截器使用错误,确保默认查询过滤已删记录
      仓储层改用 ent.Tx 与扫描辅助,避免 sql.Tx 断言问题
      同步更新集成测试以覆盖事务与统计变动
      ae191f72
    • 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
  2. 26 Dec, 2025 1 commit
  3. 25 Dec, 2025 1 commit
  4. 24 Dec, 2025 1 commit
  5. 19 Dec, 2025 1 commit
  6. 18 Dec, 2025 1 commit