feat(profile): 新增用户画像统计快捷命令 #241
Loading…
Reference in New Issue
No description provided.
Delete Branch "luwanzhou/gitlink-cli:feat/profile-shortcuts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
合并请求描述
新增
profile命令组,封装 GitLink 平台用户画像统计 API。此前这些接口无任何 shortcut 封装,gitlink-contributor-insightSkill 甚至将user +stats/user +heatmap标注为"不可用",只能用 PR 时间戳手工推算。本 PR 直接暴露平台原生画像数据,为"科研主体画像"等场景提供数据底座。相关Issue
关联Issue编号:#暂无
变更内容
1. 新增
profile命令组及 5 个子命令profile +abilityGET /users/{user}/statistics/developprofile +roleGET /users/{user}/statistics/roleprofile +majorGET /users/{user}/statistics/majorprofile +activityGET /users/{user}/statistics/activityprofile +contributionGET /users/{user}/headmaps2. 实现了
--user自动回退机制省略
--user/-u时自动调用/users/me解析当前认证用户,无需手动指定用户名即可查询自身画像数据。3. 支持时间窗口与年份筛选参数
+ability/+role/+major支持--start-time/--end-time(Unix 时间戳)按时间窗口查询+contribution支持--year按年份筛选4. 补全国际化翻译
更新
internal/i18n/locales/中英文翻译文件,覆盖所有新增命令描述和参数提示。5. 新增变更文档与使用说明
doc/changes/profile-shortcuts.md功能变更文档README.md/README.zh-CN.md使用说明6. 补全单元测试
覆盖端点路径正确性、参数映射、用户自动回退、缺失 login 字段错误处理、HTTP 错误响应处理。
使用示例
新增只读 profile 命令组,封装此前无 shortcut 覆盖的 GitLink 用户画像统计接口: profile +ability -> /users/{user}/statistics/develop profile +role -> /users/{user}/statistics/role profile +major -> /users/{user}/statistics/major profile +activity -> /users/{user}/statistics/activity profile +contribution -> /users/{user}/headmaps 省略 --user 时默认通过 /users/me 解析当前认证用户。 统计命令支持 --start-time/--end-time 时间窗口, +contribution 支持 --year 参数。 包含单元测试、中英双语 i18n 帮助文本、README 更新 及变更说明文档。