Repository navigation
Conversation
… CSV export) Backend: - model/usedata.go: add DTOs, GetUserModelStatsByUser, GetUserModelStatsBase, GetUserModelMatrix - controller/usedata.go: add handlers for by-user, by-model, matrix, CSV export - router/api-router.go: register /api/data/by-user, /by-model, /matrix, /export routes Frontend: - pages/UserModelStats: new stats page with 3 tabs (user view, model view, matrix) - components/user-model-stats: filters, bars, table, matrix table - hooks/user-model-stats: useUserModelStats state management hook - App.jsx: register /console/user-model-stats route - SiderBar.jsx: add sidebar entry for admins Docs: - plans/2026-04-09-user-model-stats.md - specs/2026-04-30-user-model-stats-implementation-plan.md
- 添加飞书OAuth绑定卡片到个人设置页面(AccountManagement) - 新增MySubscriptions组件,个人可查看生效的订阅套餐详情 - 修复feishu.enabled checkbox即时保存逻辑确认 - 修复feishu配置字段Semi Design Form绑定问题(点号→下划线映射) - 修复GetAllActiveUserSubscriptions/HasActiveUserSubscription查询遗漏end_time=0永久订阅 - 修复MySubscriptions前端渲染SubscriptionSummary嵌套结构 - 新增RepairBindGroupSubscriptions启动时自动补齐缺失的bind_group订阅记录 - 新增SyncUserBindGroupSubscriptions用户分组变更时同步订阅 - 新增SyncPlanBindGroupChange套餐bind_group变更时同步用户订阅 - 修复飞书Token交换endpoint从v1升级到v2 - 修复飞书Auth URL域名(accounts.feishu.cn)
- 新增 deploy/Dockerfile.local 本地构建镜像(仅COPY二进制) - 重写 production-deploy/build.sh 适配fork路径和ACR推送 - 更新 .env.example 镜像地址指向阿里云ACR
- 新增批量初始化用户(POST /feishu/users/batch) - 新增批量修改用户信息(PUT /feishu/users/batch) - 新增为用户创建令牌(POST /feishu/tokens) - 新增批量创建令牌(POST /feishu/tokens/batch) - 新增查询用户令牌(GET /feishu/tokens,返回完整key不脱敏) - 分组变更自动同步订阅套餐(SyncUserBindGroupSubscriptions) - 管理员OAuth绑定支持union_id/open_id优先级 - 接口文档保存至docs/feishu-admin-api.md
- ProviderUserID统一使用open_id, 通过legacy_id(union_id)做存量迁移 - 修复legacy迁移路径调用UpdateGitHubId错误, 改用UpdateFeishuId - 移除所有将feishu_id迁回union_id的逻辑(导致下次登录查不到) - 飞书OAuth登录成功后自动同步display_name - 新增model.User.UpdateFeishuId方法
- 用户视角:按用户汇总(用户/请求次数/总Token/额度消耗) - 模型视角:按模型汇总(模型/请求次数/额度消耗) - 用户模型消耗:用户+模型明细(用户/模型/请求次数/额度消耗) - 移除交叉矩阵相关代码 - 后端新增 /api/data/by-detail 接口 - 导出CSV适配三个视角
- FeishuUserUpdateItem新增user_id和username可选字段 - 查找顺序: feishu_open_id -> user_id -> username - 当提供open_id且与用户当前feishu_id不同时自动绑定
- add inactive-users export endpoint and classic tab export button - add user_group filter/columns for 3 stats views - aggregate stats by user_id to avoid rename split - switch export download to authenticated blob request - bump VERSION to 1.1.4
Update subscription usage UI with group/plan dropdown filters and remove cumulative-used display. Align monthly usage to settled records, return usable key for existing Feishu users, and fix inactive-user timestamp/export safety. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Merge latest upstream/main into fork with conflict resolution, dependency sync, and verification fixes so full Go tests and both web builds pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Apply tested relay fixes and dependency lock updates after upstream merge so full test/build verification remains green. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
daily/weekly/monthly 各自只保留最后一次同步的数据,不再累积历史周期标签
daily/weekly/monthly 各自只保留最后一次同步的数据,不再累积历史周期标签
原实现只用手机号/工号/邮箱组合查询一次,导致部分能查到的人员查不到; 现改为飞书ID、工号、手机号、邮箱、姓名逐项独立 fallback 查询, 姓名匹配多人时返回明确错误提示改用唯一标识。
设计文档:按飞书岗位自动分组。核心是新增岗位→分组映射规则表 + 创建/同步时的自动决策逻辑,复用现有 SyncUserBindGroupSubscriptions 实现订阅自动同步。包含一键初始化和受保护分组白名单。
新增「岗位 → 分组」自动映射功能: - 新建用户(OAuth/批量/管理员创建)时根据飞书 job_title 自动分配分组 - 定时同步飞书用户信息时自动重算分组(支持调岗场景) - 分组变更自动同步 bind_group 订阅套餐(复用 SyncUserBindGroupSubscriptions) - 受保护分组白名单机制,白名单内用户不被规则覆盖 - 一键初始化:基于现有用户众数生成映射规则,排除空岗位和白名单用户 - 后端:model/group_mapping.go + service/auto_group.go + controller/auto_group.go - 前端:/auto-group-rules 管理页面(规则 CRUD + 初始化 + 匹配测试) - 27 个单元/行为测试覆盖核心决策与订阅联动 - 修复 UpdateUserGroup 双重引号 bug、usage_report Sprintf 缺参数 版本: v1.2.1
# Conflicts: # model/user.go # web/default/src/i18n/locales/en.json # web/default/src/i18n/locales/fr.json # web/default/src/i18n/locales/ja.json # web/default/src/i18n/locales/ru.json # web/default/src/i18n/locales/vi.json # web/default/src/i18n/locales/zh.json
Add the auto group rules page to the admin sidebar and sidebar module visibility map so administrators can access it from the UI.
Initialize column filter state for the auto group rules table so the shared toolbar can safely read active filter counts.
Move matcher test into an action dialog, keep protected groups as a compact settings card, and complete locale strings for the auto-group UI.
Include Feishu job title in the users CSV export so automatic group rule analysis can distinguish same-name positions by organization context.
Document the upgraded auto-group matching model with organization-aware fallback rules and default high-confidence mappings.
Clarify that auto-group rules should use stable organization features and path fragments instead of requiring administrators to maintain full department paths.
Replace the complex multi-condition rule engine spec with an identity classifier, confirmation queue, and learned rule workflow to reduce admin maintenance.
Clarify that itbp and executive groups are manually maintained and excluded from automatic group assignment.
Replace direct rule management with an identity-classifier workflow that replays users, queues uncertain cases for confirmation, and only auto-applies high-confidence group suggestions.
Use Feishu contact user group membership as the primary auto-group signal and map it to token packages from the approved Base table, keeping protected groups untouched and job-title rules as fallback.
Replace identity/job-title fallback assignment with admin-managed Feishu contact group to token group mappings, keeping protected groups as the auto-assignment guardrail.
…ation - Add billing group funding policy: personal funding groups exclude company auto-assigned subscriptions (source=bind_group) - Add subscription-driven group access: users automatically gain usable groups from active subscription plan bind_groups - Add Feishu employee_no field to user model and sync - Add Feishu employee_no column to user CSV export - Add frontend config UI for billing group funding policy - Add design doc and setup guide - TDD: 18 tests covering model, service, and billing layers
- Update auto-group controller and workspace logic - Enhance feishu group mappings UI with expanded configuration - Add profile and user drawer UI improvements - Update i18n translation reports
- model/subscription.go: use upstream lockForUpdate + keep excludeBindGroup logic - service/pre_consume_quota.go: accept upstream deletion (dead file) - data-table-row-actions.tsx: adopt upstream Tooltip UI + keep Manual Sync button - AGENTS.md: merge both bun rules and billing safety invariants - i18n locales: merge both sides' new keys
Skip invalid Feishu user records without blocking report sync, propagate real sync failures, and validate Feishu identities before persisting administrator-provided IDs.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (242)
WalkthroughThis PR delivers an extensive multi-feature release: Feishu OAuth/admin integration (login, batch user init, token management, org sync, webhook), job-title/identity-based auto-grouping, per-model quota limiting, subscription bind-groups and funding isolation, usage report snapshots with Bitable push, organization accounts, and matching UI in both classic and default web frontends, plus documentation and production deployment tooling. ChangesBackend: Feishu, Auto-Group, Model Quota & Subscriptions
Frontend: Classic Web Application
Frontend: Default (TanStack) Web Application
Documentation and Production Deployment
Estimated code review effort: 5 (Critical) | ~180 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Warning |
Important
📝 变更描述 / Description
(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)
Summary by CodeRabbit