feat: add user activity statistics collection and query APIs - #664
Merged
Conversation
Introduce the user activity report skeleton: request path classification into business modules, the query API contract and controller, the retention system variable, and the cron task wiring. The collection and aggregation behaviour itself is provided by the enterprise build; the community build keeps no-op stubs so the endpoints report the feature as unavailable.
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨No code suggestions found for the PR. |
4 tasks
Seechi-Yolo
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
将用户活跃度统计功能的社区版部分从
dms-ee的定制分支上行到主干。本 PR 只含 CE 代码:请求路径到业务模块的归类、查询接口契约与 controller、保留期系统变量、cron 任务接线,以及_ce.go空桩。真正的采集与聚合实现由企业版提供(见 actiontech/dms-ee#960)。主要内容:
api/dms/service/v1/user_activity.go:概览、日趋势、模块分布、时段分布、用户排行五个查询接口的请求 / 响应模型与 swagger 注解。internal/apiserver/middleware/user_activity_path.go:把 HTTP 请求路径归一化并映射到业务模块,供采集侧标注来源;配套单测覆盖动态路径段与非业务路径。internal/apiserver/service/dms_controller_user_activity.go+router.go:controller 与路由注册。internal/dms/biz/user_activity.go、cron_task.go:领域模型、活跃时长计算与 cron 任务定义。internal/dms/biz/system_variable.go、storage/system_variable.go、pkg/dms-common/api/dms/v1/system_variable.go:新增访问日志保留时长系统变量。*_ce.go:社区版空桩,采集不落库,查询接口返回功能不可用。Problem
用户活跃度报表此前只存在于 CSVW 定制分支(
dms-ee的csvw-4.2505.x),未进入主干,后续版本无法继承。本 PR 与 actiontech/dms-ee#960 一起把该能力上行,按 CE/EE 规范拆分:通用契约与桩进 CE,采集与聚合实现留在 EE。Test plan
make EDITION=ce docker_install构建通过go test ./internal/dms/biz/ ./internal/apiserver/middleware/:活跃时长计算、请求路径归一化与业务模块判定用例全部通过go vet ./internal/... ./api/... ./pkg/dms-common/api/...:无本次改动引入的新问题dms-eedev 分支(CE+EE 合并态)本地部署验证:真实调用产生访问记录,五个查询接口返回与流量一致的统计结果internal/dms/biz中TestUpdateUserBusinessWritePermission的失败在main基线上已存在,与本次改动无关。配套前端:actiontech/dms-ui#878