1. 28 Feb, 2026 1 commit
  2. 23 Feb, 2026 1 commit
  3. 11 Feb, 2026 1 commit
    • kyx236's avatar
      feat(admin): Add email search and rate limit filtering for accounts and redeem codes · 04a1a7c2
      kyx236 authored
      - Add used_by_email column to redeem code export CSV for better user identification
      - Implement rate_limited status filter in account listing with RateLimitResetAt check
      - Extend redeem code search to include user email in addition to code matching
      - Add API key search capability to user listing filters
      - Display user email in redeem code table used_by column for improved visibility
      - Update search placeholders in UI to reflect expanded search capabilities (email, username, notes, API key)
      - Improve Chinese and English localization strings for search hints
      04a1a7c2
  4. 03 Feb, 2026 1 commit
  5. 02 Feb, 2026 1 commit
  6. 19 Jan, 2026 1 commit
    • 墨颜's avatar
      fix(redeem): 用户兑换历史不返回备注 · 6aef1af7
      墨颜 authored
      - 用户侧 RedeemCode DTO 移除 notes 字段,避免泄露内部备注\n- 新增 AdminRedeemCode,并调整管理员兑换码接口继续返回 notes\n- 增加 /api/v1/redeem/history 契约测试,确保用户侧响应不包含 notes
      6aef1af7
  7. 09 Jan, 2026 1 commit
    • IanShaw027's avatar
      fix(admin): 代码审查修复 - 输入验证和测试完善 · 7c3d5cad
      IanShaw027 authored
      根据 Codex 代码审查报告,修复所有 P0 和 P1 优先级问题。
      
      ## P0 紧急修复
      
      ### 1. 修复集成测试编译错误
      - 更新 group_repo_integration_test.go 中所有 ListWithFilters 调用
      - 添加缺失的 search 参数(传入空字符串)
      - 修复 4 处旧签名调用,避免 CI 编译失败
      
      ### 2. 添加统一的 search 参数输入验证
      为所有 admin handler 添加一致的输入验证逻辑:
      - group_handler.go: 添加 TrimSpace + 长度限制
      - proxy_handler.go: 添加 TrimSpace + 长度限制
      - redeem_handler.go: 添加 TrimSpace + 长度限制
      - user_handler.go: 添加 TrimSpace + 长度限制
      
      验证规则:
      - TrimSpace() 去除首尾空格
      - 最大长度 100 字符(防止 DoS 攻击)
      - 超长输入自动截断
      
      ## P1 改进
      
      ### 3. 补充 search 功能的单元测试
      新增 admin_service_group_test.go 中的测试:
      - TestAdminService_ListGroups_WithSearch
        - search 参数正常传递到 repository 层
        - search 为空字符串时的行为
        - search 与其他过滤条件组合使用
      
      新增 admin_service_search_test.go 文件:
      - 为其他 admin API 添加 search 测试覆盖
      - 统一的测试模式和断言
      
      ### 4. 补充 search 功能的集成测试
      新增 group_repo_integration_test.go 测试场景:
      - TestListWithFilters_Search
        - 搜索 name 字段匹配
        - 搜索 description 字段匹配
        - 搜索不存在内容(返回空)
        - 大小写不敏感测试
        - 特殊字符转义测试(%、_)
        - 与其他过滤条件组合
      
      ## 测试结果
      
      -  编译检查通过
      -  单元测试全部通过 (3/3)
      -  集成测试编译通过
      -  所有 service 测试通过
      
      ## 影响范围
      
      修改文件: 8 个
      代码变更: +234 行 / -8 行
      
      ## 相关 Issue
      
      解决代码审查中的安全性和稳定性问题:
      - 防止 DoS 攻击(超长搜索字符串)
      - 修复测试编译错误(CI 阻塞问题)
      - 提升测试覆盖率
      7c3d5cad
  8. 28 Dec, 2025 1 commit
    • shaw's avatar
      fix: 防止订阅过期时间超出 JSON 序列化范围 · fbdff4f3
      shaw authored
      问题:当分配订阅天数过大时,expires_at 年份可能超过 9999,
      导致 time.Time JSON 序列化失败(RFC 3339 要求年份 <= 9999),
      使后台无法显示和删除异常数据。
      
      修复:
      - handler 层添加 validity_days 最大值验证(max=36500,即100年)
      - service 层添加 MaxValidityDays 和 MaxExpiresAt 双重保护
      - 启动时自动修复已存在的异常数据(expires_at > 2099年)
      fbdff4f3
  9. 26 Dec, 2025 1 commit
    • shaw's avatar
      fix: admin handlers 添加 DTO 转换修复 JSON 序列化 · 739d0ee6
      shaw authored
      修复 PR #36 合并后部分 admin handler 直接返回 service 层对象导致
      JSON 字段名为 PascalCase 而非期望的 snake_case 问题。
      
      修复内容:
      - account_handler: Refresh 接口添加 dto.AccountFromService
      - openai_oauth_handler: RefreshAccountToken/CreateAccountFromOAuth 添加 dto 转换
      - subscription_handler: BulkAssign 添加 dto.BulkAssignResultFromService
      - usage_handler: List 接口添加 dto.UsageLogFromService 转换
      - 新增 dto.BulkAssignResult 类型和对应的 mapper 函数
      739d0ee6
  10. 25 Dec, 2025 1 commit
  11. 24 Dec, 2025 1 commit
  12. 20 Dec, 2025 1 commit
    • NepetaLemon's avatar
      ci(backend): 添加 github actions (#10) · c6b3de11
      NepetaLemon authored
      ## 变更内容
      
      ### CI/CD
      - 添加 GitHub Actions 工作流(test + golangci-lint)
      - 添加 golangci-lint 配置,启用 errcheck/govet/staticcheck/unused/depguard
      - 通过 depguard 强制 service 层不能直接导入 repository
      
      ### 错误处理修复
      - 修复 CSV 写入、SSE 流式输出、随机数生成等未处理的错误
      - GenerateRedeemCode() 现在返回 error
      
      ### 资源泄露修复
      - 统一使用 defer func() { _ = xxx.Close() }() 模式
      
      ### 代码清理
      - 移除未使用的常量
      - 简化 nil map 检查
      - 统一代码格式
      c6b3de11
  13. 18 Dec, 2025 1 commit