| 序号 | +类型 | +系统消息模版 | +邮件模版 | +通知地址 | +操作 | +
|---|
更改用户信息
+获取用户消息列表
-示例:
curl -X PATCH/PUT http://localhost:3000/api/users/yystopf.json
-await octokit.request('PATCH/PUT /api/users/:login.json')
+curl -X GET http://localhost:3000/api/users/:login/messages.json
+
await octokit.request('GET /api/users/:login/messages.json')
HTTP 请求
-PATCH/PUT /api/users/:login.json
+GET api/users/yystopf/messages.json
请求字段说明:
@@ -990,222 +1028,229 @@ Success — a happy kitten is an authenticated kitten!
-user.nickname
+type
string
-用户昵称
+消息类型,不传为所有消息,notification为系统消息,atme为@我消息
-user.image
-base64/file
-用户头像
+status
+integer
+是否已读,不传为所有消息,1为未读,2为已读
-user.user_extension_attributes.gender
-int
-性别, 0男 1女
+limit
+integer
+每页个数
-user.user_extension_attributes.province
-string
-省份
+page
+integer
+页码
+
+返回字段说明:
+
-user.user_extension_attributes.city
+参数
+类型
+字段说明
+
+
+
+total_count
+integer
+消息总数
+
+
+type
string
-城市
+消息类型
-user.user_extension_attributes.description
+unread_notification
+integer
+未读系统通知数量
+
+
+unread_atme
+integer
+未读@我数量
+
+
+messages.id
+integer
+消息id
+
+
+messages.status
+integer
+消息是否已读,1为未读,2为已读
+
+
+messages.content
string
-简介
+消息内容
-user.user_extension_attributes.custom_department
+messages.notification_url
string
-单位名称
+消息跳转地址
-user.user_extension_attributes.technical_title
+messages.source
string
-职业
+消息来源
-user.user_extension_attributes.show_email
-bool
-是否展示邮箱
+messages.timeago
+string
+消息时间
-user.user_extension_attributes.show_location
-bool
-是否展示位置
+messages.type
+string
+消息类型,notification为系统消息,atme为@我消息
-user.user_extension_attributes.show_department
-bool
-是否展示公司
+sender
+object
+消息发送者
-
-
-请求的JSON示例:
-
-{
- "user": {
- "nickname": "xxx",
- "user_extension_attributes": {
- "gender": 0,
- "province": "湖南",
- "city": "长沙",
- "description": "个性签名",
- "custom_department": "湖南智擎科技有限公司",
- }
- }
-}
-
-
-返回的JSON示例:
-
-{
- "status": 0,
- "message": "success"
-}
-
获取用户星标项目
-获取用户星标项目
-
-
-示例:
-
-curl -X GET http://localhost:3000/api/users/yystopf/is_pinned_projects.json
-
await octokit.request('GET /api/users/:login/is_pinned_projects.json')
-
HTTP 请求
-GET api/users/:login/is_pinned_projects.json
-返回字段说明:
+消息来源source字段说明
-参数
类型
-字段说明
+说明
-total_count
-int
-星标项目数量
+IssueAssigned
+有新指派给我的易修
-identifier
-string
-项目标识
+IssueAssignerExpire
+我负责的易修截止日期到达最后一天
-name
-string
-项目名称
+IssueAtme
+在易修中@我
-description
-string
-项目描述
+IssueChanged
+我创建或负责的易修状态变更
-visits
-int
-项目访问数量
+IssueCreatorExpire
+我创建的易修截止日期到达最后一天
-praises_count
-int
-项目点赞数量
+IssueDeleted
+我创建或负责的易修删除
-watchers_count
-int
-项目关注数量
+IssueJournal
+我创建或负责的易修有新的评论
-issues_count
-int
-项目issue数量
+LoginIpTip
+登录异常提示
-pull_requests_count
-int
-项目合并请求数量
+OrganizationJoined
+账号被拉入组织
-forked_count
-int
-项目复刻数量
+OrganizationLeft
+账号被移出组织
-is_public
-bool
-项目是否公开
+OrganizationRole
+账号组织权限变更
-mirror_url
-string
-镜像地址
+ProjectDeleted
+我关注的仓库被删除
-type
-int
-项目类型 0 普通项目 1 普通镜像项目 2 同步镜像项目
+ProjectFollowed
+我管理的仓库被关注
-time_ago
-string
-上次更新时间
+ProjectForked
+我管理的仓库被复刻
-open_devops
-int
-是否开启devops
+ProjectIssue
+我管理/关注的仓库有新的易修
-forked_from_project_id
-int
-fork项目id
+ProjectJoined
+账号被拉入项目
-platform
-string
-项目平台
+ProjectLeft
+账号被移出项目
-author.name
-string
-项目拥有者名称
+ProjectMemberJoined
+我管理的仓库有成员加入
-author.type
-string
-项目拥有者类型
+ProjectMemberLeft
+我管理的仓库有成员移出
-author.login
-string
-项目拥有者用户名
+ProjectMilestone
+我管理的仓库有新的里程碑
-author.image_url
-string
-项目拥有者头像
+ProjectPraised
+我管理的仓库被点赞
-category.name
-string
-项目分类名称
+ProjectPullRequest
+我管理/关注的仓库有新的合并请求
-language.name
-string
-项目语言名称
+ProjectRole
+账号仓库权限变更
-position
-int
-项目排序
+ProjectSettingChanged
+我管理的仓库项目设置被更改
+
+
+ProjectTransfer
+我关注的仓库被转移
+
+
+ProjectVersion
+我关注的仓库有新的发行版
+
+
+PullRequestAssigned
+有新指派给我的合并请求
+
+
+PullReuqestAtme
+在合并请求中@我
+
+
+PullRequestChanged
+我创建或负责的合并请求状态变更
+
+
+PullRequestClosed
+我创建或负责的合并请求被关闭
+
+
+PullRequestJournal
+我创建或负责的合并请求有新的评论
+
+
+PullRequestMerged
+我创建或负责的合并请求被合并
@@ -1213,42 +1258,69 @@ Success — a happy kitten is an authenticated kitten!
返回的JSON示例:
{
- "total_count": 1,
- "projects": [
+ "total_count": 5,
+ "type": "",
+ "unread_notification": 3,
+ "unread_atme": 2,
+ "messages": [
{
- "id": 89,
- "repo_id": 89,
- "identifier": "monkey",
- "name": "boke",
- "description": "dkkd",
- "visits": 4,
- "praises_count": 0,
- "watchers_count": 0,
- "issues_count": 0,
- "pull_requests_count": 0,
- "forked_count": 0,
- "is_public": true,
- "mirror_url": "https://github.com/viletyy/monkey.git",
- "type": 1,
- "last_update_time": 1619685144,
- "time_ago": "27天前",
- "forked_from_project_id": null,
- "open_devops": false,
- "platform": "forge",
- "author": {
- "name": "测试组织",
- "type": "Organization",
- "login": "ceshi_org",
- "image_url": "images/avatars/Organization/9?t=1612706073"
- },
- "category": {
- "id": 3,
- "name": "深度学习"
- },
- "language": {
- "id": 2,
- "name": "C"
+ "id": 1,
+ "status": 1,
+ "content": "Atme Message Content 1",
+ "notification_url": "http://www.baidu.com",
+ "source": "PullRequestAtme",
+ "time_ago": "1天前",
+ "type": "atme",
+ "sender": {
+ "id": 5,
+ "type": "User",
+ "name": "testforge2",
+ "login": "testforge2",
+ "image_url": "system/lets/letter_avatars/2/T/236_177_85/120.png"
+ }
+ },
+ {
+ "id": 2,
+ "status": 0,
+ "content": "Atme Message Content 2",
+ "notification_url": "http://www.baidu.com",
+ "source": "IssueAtme",
+ "time_ago": "1天前",
+ "type": "atme",
+ "sender": {
+ "id": 4,
+ "type": "User",
+ "name": "testforge1",
+ "login": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
}
+ },
+ {
+ "id": 3,
+ "status": 1,
+ "content": "Notification Message Content 1",
+ "notification_url": "http://www.baidu.com",
+ "source": "IssueDelete",
+ "time_ago": "1天前",
+ "type": "notification"
+ },
+ {
+ "id": 4,
+ "status": 0,
+ "content": "Notification Message Content 2",
+ "notification_url": "http://www.baidu.com",
+ "source": "IssueChanged",
+ "time_ago": "1天前",
+ "type": "notification"
+ },
+ {
+ "id": 5,
+ "status": 0,
+ "content": "Notification Message Content 3",
+ "notification_url": "http://www.baidu.com",
+ "source": "ProjectJoined",
+ "time_ago": "1天前",
+ "type": "notification"
}
]
}
@@ -1256,17 +1328,17 @@ Success — a happy kitten is an authenticated kitten!
-用户添加星标项目
-用户添加星标项目
+发送消息
+发送消息, 目前只支持atme
示例:
-curl -X POST http://localhost:3000/api/users/yystopf/is_pinned_projects/pin.json
-
await octokit.request('GET /api/users/:login/is_pinned_projects/pin.json')
-
HTTP 请求
-POST /api/users/:login/is_pinned_projects/pin.json
-请求字段说明:
同时设定多个星标项目
+curl -X POST http://localhost:3000/api/users/:login/messages.json
+
await octokit.request('POST /api/users/:login/messages.json')
+
HTTP 请求
+POST api/users/yystopf/messages.json
+请求字段说明:
参数
@@ -1275,26 +1347,37 @@ Success — a happy kitten is an authenticated kitten!
-is_pinned_project_ids
+type
+string
+消息类型
+
+
+receivers_login
array
-设定为星标项目的id
+需要发送消息的用户名数组
-
-只设定一个星标项目
-
-参数
-类型
-字段说明
+atmeable_type
+string
+atme消息对象,是从哪里@我的,比如评论:Journal、易修:Issue、合并请求:PullRequest
-
-is_pinned_project_id
+atmeable_id
integer
-设定为星标项目的id
+atme消息对象id
+
+请求的JSON示例:
+
+{
+ "type": "atme",
+ "receivers_login": ["yystopf", "testforge1"],
+ "atmeable_type": "Journal",
+ "atmeable_id": 67
+}
+
返回的JSON示例:
@@ -1302,16 +1385,20 @@ Success — a happy kitten is an authenticated kitten!
"status": 0,
"message": "success"
}
-
星标项目展示排序
-星标项目展示排序
+阅读消息
-示例:
curl -X PATCH http://localhost:3000/api/users/yystopf/is_pinned_projects/11.json
-await octokit.request('PATCH/PUT /api/users/:login/is_pinned_projects/:id.json')
-PATCH/PUT /api/users/:login/is_pinned_projects/:id.json
curl -X POST http://localhost:3000/api/users/:login/messages/read.json
+await octokit.request('POST /api/users/:login/messages/read.json')
+POST api/users/yystopf/messages/read.json
| pinned_projects.position | -int | -排序,数字越大排名越前 | +type | +string | +消息类型,不传为所有消息,notification为系统消息,atme为@我消息 | +
| ids | +array | +消息id数组,包含-1则把所有未读消息标记为已读 |
--请求的JSON示例:
-
{
- "pinned_project": {
- "position": 1
- }
-}
-@@ -1343,17 +1426,21 @@ Success — a happy kitten is an authenticated kitten! "status": 0, "message": "success" } -返回的JSON示例:
用户近期活动统计, 默认显示近一周的数据
+ + +删除消息
-示例:
curl -X GET http://localhost:3000/api/users/yystopf/statistics/activity.json
-await octokit.request('GET /api/users/:login/statistics/activity.json')
-GET /api/users/:login/statistics/activity.json
curl -X DELETE http://localhost:3000/api/users/:login/messages.json
+await octokit.request('DELETE /api/users/:login/messages.json')
+DELETE api/users/yystopf/messages.json
| 参数 | @@ -1362,24 +1449,14 @@ Success — a happy kitten is an authenticated kitten!|||||
|---|---|---|---|---|---|
| dates | -array | -时间 | -|||
| issues_count | -array | -易修数量 | -|||
| pull_requests_count | -array | -合并请求数量 | +type | +string | +消息类型,atme为@我消息 |
| commtis_count | +ids | array | -贡献数量 | +消息id数组,包含-1则把所有消息删除 |
返回的JSON示例:
{
- "dates": [
- "2021.05.21",
- "2021.05.22",
- "2021.05.23",
- "2021.05.24",
- "2021.05.25",
- "2021.05.26",
- "2021.05.27",
- "2021.05.28"
- ],
- "issues_count": [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "pull_requests_count": [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- "commits_count": [
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ]
+ "status": 0,
+ "message": "success"
}
获取用户贡献度
+更改用户信息
-示例:
curl -X GET http://localhost:3000/api/users/yystopf/headmaps.json
-await octokit.request('GET /api/users/:login/headmaps.json')
-GET api/users/:login/headmaps.json
curl -X PATCH/PUT http://localhost:3000/api/users/yystopf.json
+await octokit.request('PATCH/PUT /api/users/:login.json')
+PATCH/PUT /api/users/:login.json
| 参数 | @@ -1451,143 +1490,96 @@ Success — a happy kitten is an authenticated kitten!||||
|---|---|---|---|---|
| year | +user.nickname | string | -年份 | +用户昵称 |
| 参数 | -类型 | -字段说明 | +user.image | +base64/file | +用户头像 |
|---|---|---|---|---|---|
| total_contributions | +user.user_extension_attributes.gender | int | -所选时间内的总贡献度 | +性别, 0男 1女 | |
| headmaps.date | +user.user_extension_attributes.province | string | -时间 | +省份 | |
| headmaps.contributions | -int | -贡献度 | +user.user_extension_attributes.city | +string | +城市 | +
| user.user_extension_attributes.description | +string | +简介 | +|||
| user.user_extension_attributes.custom_department | +string | +单位名称 | +|||
| user.user_extension_attributes.technical_title | +string | +职业 | +|||
| user.user_extension_attributes.show_email | +bool | +是否展示邮箱 | +|||
| user.user_extension_attributes.show_location | +bool | +是否展示位置 | +|||
| user.user_extension_attributes.show_department | +bool | +是否展示公司 |
++请求的JSON示例:
+
{
+ "user": {
+ "nickname": "xxx",
+ "user_extension_attributes": {
+ "gender": 0,
+ "province": "湖南",
+ "city": "长沙",
+ "description": "个性签名",
+ "custom_department": "湖南智擎科技有限公司",
+ }
+ }
+}
+返回的JSON示例:
{
- "total_contributions": 139,
- "headmaps": [
- {
- "date": "2021-02-07",
- "contributions": 1
- },
- {
- "date": "2021-02-21",
- "contributions": 13
- },
- {
- "date": "2021-02-25",
- "contributions": 5
- },
- {
- "date": "2021-03-01",
- "contributions": 2
- },
- {
- "date": "2021-03-04",
- "contributions": 1
- },
- {
- "date": "2021-03-15",
- "contributions": 9
- },
- {
- "date": "2021-03-22",
- "contributions": 14
- },
- {
- "date": "2021-03-24",
- "contributions": 1
- },
- {
- "date": "2021-03-30",
- "contributions": 11
- },
- {
- "date": "2021-04-06",
- "contributions": 1
- },
- {
- "date": "2021-04-12",
- "contributions": 1
- },
- {
- "date": "2021-04-13",
- "contributions": 2
- },
- {
- "date": "2021-04-19",
- "contributions": 3
- },
- {
- "date": "2021-04-23",
- "contributions": 37
- },
- {
- "date": "2021-04-25",
- "contributions": 2
- },
- {
- "date": "2021-04-26",
- "contributions": 6
- },
- {
- "date": "2021-04-28",
- "contributions": 1
- },
- {
- "date": "2021-04-29",
- "contributions": 18
- },
- {
- "date": "2021-04-30",
- "contributions": 9
- },
- {
- "date": "2021-05-04",
- "contributions": 1
- },
- {
- "date": "2021-05-06",
- "contributions": 1
- }
- ]
+ "status": 0,
+ "message": "success"
}
-获取用户动态
+获取用户星标项目
-示例:
curl -X GET http://localhost:3000/api/users/yystopf/project_trends.json
-await octokit.request('GET /api/users/:login/project_trends.json')
-GET api/users/:login/project_trends.json
curl -X GET http://localhost:3000/api/users/yystopf/is_pinned_projects.json
+await octokit.request('GET /api/users/:login/is_pinned_projects.json')
+GET api/users/:login/is_pinned_projects.json
| 参数 | @@ -1596,63 +1588,124 @@ Success — a happy kitten is an authenticated kitten!|||
|---|---|---|---|
| date | +total_count | +int | +星标项目数量 | +
| identifier | string | -日期,格式: 2021-05-28 | +项目标识 |
| 参数 | -类型 | -字段说明 | +name | +string | +项目名称 |
|---|---|---|---|---|---|
| total_count | +description | +string | +项目描述 | +||
| visits | int | -所选时间内的总动态数 | +项目访问数量 | ||
| project_trends.trend_type | +praises_count | +int | +项目点赞数量 | +||
| watchers_count | +int | +项目关注数量 | +|||
| issues_count | +int | +项目issue数量 | +|||
| pull_requests_count | +int | +项目合并请求数量 | +|||
| forked_count | +int | +项目复刻数量 | +|||
| is_public | +bool | +项目是否公开 | +|||
| mirror_url | string | -动态类型,Issue:易修,VersionRelease:版本发布,PullRequest:合并请求 | +镜像地址 | ||
| project_trends.action_type | +type | +int | +项目类型 0 普通项目 1 普通镜像项目 2 同步镜像项目 | +||
| time_ago | string | -操作类型 | +上次更新时间 | ||
| project_trends.trend_id | -integer | -动态id | +open_devops | +int | +是否开启devops |
| project_trends.user_name | +forked_from_project_id | +int | +fork项目id | +||
| platform | string | -用户名称 | +项目平台 | ||
| project_trends.user_login | +author.name | string | -用户用户名 | +项目拥有者名称 | |
| project_trends.user_avatar | +author.type | string | -用户头像 | +项目拥有者类型 | |
| project_trends.action_time | +author.login | string | -操作时间 | +项目拥有者用户名 | |
| project_trends.name | +author.image_url | string | -动态标题 | +项目拥有者头像 | +|
| category.name | +string | +项目分类名称 | +|||
| language.name | +string | +项目语言名称 | +|||
| position | +int | +项目排序 |
返回的JSON示例:
{
- "total_count": 16,
- "project_trends": [
- {
- "id": 27,
- "trend_type": "Issue",
- "action_type": "创建了工单",
- "trend_id": 18,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "21天前",
- "name": "31213123123",
- "issue_type": "1",
- "status_id": 2,
- "priority_id": 4,
- "created_at": "2021-05-07 15:39",
- "updated_at": "2021-05-27 15:42",
- "assign_user_name": "yystopf",
- "assign_user_login": "yystopf",
- "issue_journal_size": 1,
- "issue_journals": []
- },
- {
- "id": 8,
- "trend_type": "VersionRelease",
- "action_type": "创建了版本发布",
- "trend_id": 8,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "24天前",
- "name": "heihei1",
- "tag_name": "v1.0",
- "target_commitish": "master",
- "tarball_url": "http://localhost:10080/forgeceshiorg1/ceshi1/archive/v1.0.tar.gz",
- "zipball_url": "http://localhost:10080/forgeceshiorg1/ceshi1/archive/v1.0.zip",
- "url": "http://localhost:10080/api/v1/repos/forgeceshiorg1/ceshi1/releases/84",
- "version_gid": "84",
- "created_at": "2021-05-04 12:04"
- },
+ "total_count": 1,
+ "projects": [
{
- "id": 25,
- "trend_type": "PullRequest",
- "action_type": "关闭了合并请求",
- "trend_id": 14,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "28天前",
- "name": "13",
- "created_at": "2021-04-30 15:39"
- },
+ "id": 89,
+ "repo_id": 89,
+ "identifier": "monkey",
+ "name": "boke",
+ "description": "dkkd",
+ "visits": 4,
+ "praises_count": 0,
+ "watchers_count": 0,
+ "issues_count": 0,
+ "pull_requests_count": 0,
+ "forked_count": 0,
+ "is_public": true,
+ "mirror_url": "https://github.com/viletyy/monkey.git",
+ "type": 1,
+ "last_update_time": 1619685144,
+ "time_ago": "27天前",
+ "forked_from_project_id": null,
+ "open_devops": false,
+ "platform": "forge",
+ "author": {
+ "name": "测试组织",
+ "type": "Organization",
+ "login": "ceshi_org",
+ "image_url": "images/avatars/Organization/9?t=1612706073"
+ },
+ "category": {
+ "id": 3,
+ "name": "深度学习"
+ },
+ "language": {
+ "id": 2,
+ "name": "C"
+ }
+ }
+ ]
+}
+用户添加星标项目
+ +++示例:
+
curl -X POST http://localhost:3000/api/users/yystopf/is_pinned_projects/pin.json
+await octokit.request('GET /api/users/:login/is_pinned_projects/pin.json')
+POST /api/users/:login/is_pinned_projects/pin.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| is_pinned_project_ids | +array | +设定为星标项目的id | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| is_pinned_project_id | +integer | +设定为星标项目的id | +
++返回的JSON示例:
+
{
+ "status": 0,
+ "message": "success"
+}
+星标项目展示排序
+ +++示例:
+
curl -X PATCH http://localhost:3000/api/users/yystopf/is_pinned_projects/11.json
+await octokit.request('PATCH/PUT /api/users/:login/is_pinned_projects/:id.json')
+PATCH/PUT /api/users/:login/is_pinned_projects/:id.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| pinned_projects.position | +int | +排序,数字越大排名越前 | +
++请求的JSON示例:
+
{
+ "pinned_project": {
+ "position": 1
+ }
+}
+++返回的JSON示例:
+
{
+ "status": 0,
+ "message": "success"
+}
+用户近期活动统计, 默认显示近一周的数据
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/statistics/activity.json
+await octokit.request('GET /api/users/:login/statistics/activity.json')
+GET /api/users/:login/statistics/activity.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| dates | +array | +时间 | +
| issues_count | +array | +易修数量 | +
| pull_requests_count | +array | +合并请求数量 | +
| commtis_count | +array | +贡献数量 | +
++返回的JSON示例:
+
{
+ "dates": [
+ "2021.05.21",
+ "2021.05.22",
+ "2021.05.23",
+ "2021.05.24",
+ "2021.05.25",
+ "2021.05.26",
+ "2021.05.27",
+ "2021.05.28"
+ ],
+ "issues_count": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "pull_requests_count": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ "commits_count": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ]
+}
+获取用户贡献度
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/headmaps.json
+await octokit.request('GET /api/users/:login/headmaps.json')
+GET api/users/:login/headmaps.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| year | +string | +年份 | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| total_contributions | +int | +所选时间内的总贡献度 | +
| headmaps.date | +string | +时间 | +
| headmaps.contributions | +int | +贡献度 | +
++返回的JSON示例:
+
{
+ "total_contributions": 139,
+ "headmaps": [
+ {
+ "date": "2021-02-07",
+ "contributions": 1
+ },
+ {
+ "date": "2021-02-21",
+ "contributions": 13
+ },
+ {
+ "date": "2021-02-25",
+ "contributions": 5
+ },
+ {
+ "date": "2021-03-01",
+ "contributions": 2
+ },
+ {
+ "date": "2021-03-04",
+ "contributions": 1
+ },
+ {
+ "date": "2021-03-15",
+ "contributions": 9
+ },
+ {
+ "date": "2021-03-22",
+ "contributions": 14
+ },
+ {
+ "date": "2021-03-24",
+ "contributions": 1
+ },
+ {
+ "date": "2021-03-30",
+ "contributions": 11
+ },
+ {
+ "date": "2021-04-06",
+ "contributions": 1
+ },
+ {
+ "date": "2021-04-12",
+ "contributions": 1
+ },
+ {
+ "date": "2021-04-13",
+ "contributions": 2
+ },
+ {
+ "date": "2021-04-19",
+ "contributions": 3
+ },
+ {
+ "date": "2021-04-23",
+ "contributions": 37
+ },
+ {
+ "date": "2021-04-25",
+ "contributions": 2
+ },
+ {
+ "date": "2021-04-26",
+ "contributions": 6
+ },
+ {
+ "date": "2021-04-28",
+ "contributions": 1
+ },
+ {
+ "date": "2021-04-29",
+ "contributions": 18
+ },
+ {
+ "date": "2021-04-30",
+ "contributions": 9
+ },
+ {
+ "date": "2021-05-04",
+ "contributions": 1
+ },
+ {
+ "date": "2021-05-06",
+ "contributions": 1
+ }
+ ]
+}
+获取用户动态
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/project_trends.json
+await octokit.request('GET /api/users/:login/project_trends.json')
+GET api/users/:login/project_trends.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| date | +string | +日期,格式: 2021-05-28 | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| total_count | +int | +所选时间内的总动态数 | +
| project_trends.trend_type | +string | +动态类型,Issue:易修,VersionRelease:版本发布,PullRequest:合并请求 | +
| project_trends.action_type | +string | +操作类型 | +
| project_trends.trend_id | +integer | +动态id | +
| project_trends.user_name | +string | +用户名称 | +
| project_trends.user_login | +string | +用户用户名 | +
| project_trends.user_avatar | +string | +用户头像 | +
| project_trends.action_time | +string | +操作时间 | +
| project_trends.name | +string | +动态标题 | +
++返回的JSON示例:
+
{
+ "total_count": 16,
+ "project_trends": [
+ {
+ "id": 27,
+ "trend_type": "Issue",
+ "action_type": "创建了工单",
+ "trend_id": 18,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "21天前",
+ "name": "31213123123",
+ "issue_type": "1",
+ "status_id": 2,
+ "priority_id": 4,
+ "created_at": "2021-05-07 15:39",
+ "updated_at": "2021-05-27 15:42",
+ "assign_user_name": "yystopf",
+ "assign_user_login": "yystopf",
+ "issue_journal_size": 1,
+ "issue_journals": []
+ },
+ {
+ "id": 8,
+ "trend_type": "VersionRelease",
+ "action_type": "创建了版本发布",
+ "trend_id": 8,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "24天前",
+ "name": "heihei1",
+ "tag_name": "v1.0",
+ "target_commitish": "master",
+ "tarball_url": "http://localhost:10080/forgeceshiorg1/ceshi1/archive/v1.0.tar.gz",
+ "zipball_url": "http://localhost:10080/forgeceshiorg1/ceshi1/archive/v1.0.zip",
+ "url": "http://localhost:10080/api/v1/repos/forgeceshiorg1/ceshi1/releases/84",
+ "version_gid": "84",
+ "created_at": "2021-05-04 12:04"
+ },
+ {
+ "id": 25,
+ "trend_type": "PullRequest",
+ "action_type": "关闭了合并请求",
+ "trend_id": 14,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "28天前",
+ "name": "13",
+ "created_at": "2021-04-30 15:39"
+ },
{
"id": 24,
"trend_type": "PullRequest",
@@ -1724,187 +2224,1645 @@ Success — a happy kitten is an authenticated kitten!
"name": "211212",
"created_at": "2021-04-30 15:37"
},
- {
- "id": 23,
- "trend_type": "PullRequest",
- "action_type": "创建了合并请求",
- "trend_id": 12,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "28天前",
- "name": "奇偶哦iu",
- "created_at": "2021-04-30 10:19"
+ {
+ "id": 23,
+ "trend_type": "PullRequest",
+ "action_type": "创建了合并请求",
+ "trend_id": 12,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "28天前",
+ "name": "奇偶哦iu",
+ "created_at": "2021-04-30 10:19"
+ },
+ {
+ "id": 22,
+ "trend_type": "PullRequest",
+ "action_type": "创建了合并请求",
+ "trend_id": 11,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "28天前",
+ "name": "2112123",
+ "created_at": "2021-04-29 18:46"
+ },
+ {
+ "id": 21,
+ "trend_type": "PullRequest",
+ "action_type": "关闭了合并请求",
+ "trend_id": 10,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "28天前",
+ "name": "23123",
+ "created_at": "2021-04-29 18:45"
+ },
+ {
+ "id": 20,
+ "trend_type": "PullRequest",
+ "action_type": "创建了合并请求",
+ "trend_id": 9,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "28天前",
+ "name": "33",
+ "created_at": "2021-04-29 18:37"
+ },
+ {
+ "id": 19,
+ "trend_type": "PullRequest",
+ "action_type": "关闭了合并请求",
+ "trend_id": 8,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "28天前",
+ "name": "gggg",
+ "created_at": "2021-04-29 17:51"
+ },
+ {
+ "id": 16,
+ "trend_type": "Issue",
+ "action_type": "创建了工单",
+ "trend_id": 8,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "1个月前",
+ "name": "hjhkj",
+ "issue_type": "1",
+ "status_id": 1,
+ "priority_id": 2,
+ "created_at": "2021-04-19 10:52",
+ "updated_at": "2021-04-19 10:52",
+ "assign_user_name": null,
+ "assign_user_login": null,
+ "issue_journal_size": 0,
+ "issue_journals": []
+ },
+ {
+ "id": 7,
+ "trend_type": "VersionRelease",
+ "action_type": "创建了版本发布",
+ "trend_id": 7,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "1个月前",
+ "name": "v3.0.1",
+ "tag_name": "v3.0.1",
+ "target_commitish": "master",
+ "tarball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v3.0.1.tar.gz",
+ "zipball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v3.0.1.zip",
+ "url": "http://localhost:10080/api/v1/repos/yystopf/ceshirepo1/releases/78",
+ "version_gid": "78",
+ "created_at": "2021-03-30 15:51"
+ },
+ {
+ "id": 6,
+ "trend_type": "VersionRelease",
+ "action_type": "创建了版本发布",
+ "trend_id": 6,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "1个月前",
+ "name": "v3.0.0",
+ "tag_name": "v3.0.0",
+ "target_commitish": "master",
+ "tarball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v3.0.0.tar.gz",
+ "zipball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v3.0.0.zip",
+ "url": "http://localhost:10080/api/v1/repos/yystopf/ceshirepo1/releases/77",
+ "version_gid": "77",
+ "created_at": "2021-03-30 15:33"
+ },
+ {
+ "id": 5,
+ "trend_type": "VersionRelease",
+ "action_type": "创建了版本发布",
+ "trend_id": 5,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "1个月前",
+ "name": "v1.0.0",
+ "tag_name": "v1.0.0",
+ "target_commitish": "master",
+ "tarball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v1.0.0.tar.gz",
+ "zipball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v1.0.0.zip",
+ "url": "http://localhost:10080/api/v1/repos/yystopf/ceshirepo1/releases/76",
+ "version_gid": "76",
+ "created_at": "2021-03-30 15:27"
+ },
+ {
+ "id": 2,
+ "trend_type": "VersionRelease",
+ "action_type": "创建了版本发布",
+ "trend_id": 2,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "2个月前",
+ "name": "vvvv",
+ "tag_name": "v1.1",
+ "target_commitish": "dev",
+ "tarball_url": "http://localhost:10080/yystopf/virus_blog/archive/v1.1.tar.gz",
+ "zipball_url": "http://localhost:10080/yystopf/virus_blog/archive/v1.1.zip",
+ "url": "http://localhost:10080/api/v1/repos/yystopf/virus_blog/releases/6",
+ "version_gid": "6",
+ "created_at": "2021-03-15 14:18"
+ },
+ {
+ "id": 2,
+ "trend_type": "PullRequest",
+ "action_type": "创建了合并请求",
+ "trend_id": 2,
+ "user_name": "yystopf",
+ "user_login": "yystopf",
+ "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
+ "action_time": "3个月前",
+ "name": "444",
+ "created_at": "2021-02-25 17:31"
+ }
+ ]
+}
+用户开发能力, 默认为所有时间下的开发能力
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/statistics/develop.json
+await octokit.request('GET /api/users/:login/statistics/develop.json')
+GET /api/users/:login/statistics/develop.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| start_time | +integer | +时间戳,开始时间,格式:1621526400 | +
| end_time | +integer | +时间戳,结束时间,格式:1622131200 | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| influence | +int | +影响力 | +
| contribution | +int | +贡献度 | +
| activity | +int | +活跃度 | +
| experience | +int | +项目经验 | +
| language | +int | +语言能力 | +
| languages_percent | +float | +语言百分比 | +
| each_language_score | +int | +各门语言分数 | +
++返回的JSON示例:
+
{
+ "platform": {
+ "influence": 61,
+ "contribution": 75,
+ "activity": 66,
+ "experience": 95,
+ "language": 87,
+ "languages_percent": {
+ "CSS": 0.03,
+ "C#": 0.13,
+ "Ruby": 0.04,
+ "Go": 0.05,
+ "C": 0.19,
+ "Java": 0.34,
+ "Python": 0.09,
+ "C+": 0.01,
+ "C++": 0.11,
+ "Scala": 0.01,
+ "HTML": 0.01
+ },
+ "each_language_score": {
+ "CSS": 71,
+ "C#": 86,
+ "Ruby": 75,
+ "Go": 77,
+ "C": 90,
+ "Java": 93,
+ "Python": 83,
+ "C+": 66,
+ "C++": 85,
+ "Scala": 66,
+ "HTML": 66
+ }
+ },
+ "user": {
+ "influence": 60,
+ "contribution": 72,
+ "activity": 65,
+ "experience": 88,
+ "language": 84,
+ "languages_percent": {
+ "C": 0.25,
+ "C#": 0.33,
+ "C++": 0.13,
+ "CSS": 0.08,
+ "Go": 0.04,
+ "HTML": 0.04,
+ "Java": 0.04,
+ "Ruby": 0.08
},
- {
- "id": 22,
- "trend_type": "PullRequest",
- "action_type": "创建了合并请求",
- "trend_id": 11,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "28天前",
- "name": "2112123",
- "created_at": "2021-04-29 18:46"
+ "each_language_score": {
+ "C": 81,
+ "C#": 84,
+ "C++": 75,
+ "CSS": 71,
+ "Go": 66,
+ "HTML": 66,
+ "Java": 66,
+ "Ruby": 71
+ }
+ }
+}
+用户角色定位,默认显示所有时间下的角色定位数据
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/statistics/role.json
+await octokit.request('GET /api/users/:login/statistics/role.json')
+GET /api/users/:login/statistics/role.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| start_time | +integer | +时间戳,开始时间,格式:1621526400 | +
| end_time | +integer | +时间戳,结束时间,格式:1622131200 | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| total_projects_count | +int | +用户所有的项目数量 | +
| role.object.count | +int | +用户该语言下的项目数量 | +
| role.object.percent | +float | +用户该语言下的项目占比 | +
++返回的JSON示例:
+
{
+ "total_projects_count": 27,
+ "role": {
+ "owner": {
+ "count": 24,
+ "percent": 0.89
},
- {
- "id": 21,
- "trend_type": "PullRequest",
- "action_type": "关闭了合并请求",
- "trend_id": 10,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "28天前",
- "name": "23123",
- "created_at": "2021-04-29 18:45"
+ "manager": {
+ "count": 1,
+ "percent": 0.04
+ },
+ "developer": {
+ "count": 2,
+ "percent": 0.07
},
+ "reporter": {
+ "count": 0,
+ "percent": 0.0
+ }
+ }
+}
+用户专业定位,默认显示所有时间下的专业定位数据
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/statistics/major.json
+await octokit.request('GET /api/users/:login/statistics/major.json')
+GET /api/users/:login/statistics/major.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| start_time | +integer | +时间戳,开始时间,格式:1621526400 | +
| end_time | +integer | +时间戳,结束时间,格式:1622131200 | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| categories | +int | +用户项目分类 | +
++返回的JSON示例:
+
{
+ "categories": [
+ "大数据",
+ "机器学习",
+ "深度学习",
+ "人工智能",
+ "智慧医疗",
+ "云计算"
+ ]
+}
+待办事项-用户通知信息
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/applied_messages.json
+await octokit.request('GET /api/users/:login/applied_messages.json')
+GET /api/users/:login/applied_messages.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| login | +string | +用户标识 | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| applied | +object | +通知主体 | +
| applied.id | +int | +通知主体的迁移id | +
| applied.status | +string | +通知主体的迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | +
| applied.time_ago | +string | +通知主体的迁移创建的时间 | +
| applied.project.id | +int | +通知主体的迁移项目的id | +
| applied.project.identifier | +string | +通知主体的迁移项目的标识 | +
| applied.project.name | +string | +通知主体的迁移项目的名称 | +
| applied.project.description | +string | +通知主体的迁移项目的描述 | +
| applied.project.is_public | +bool | +通知主体的迁移项目是否公开 | +
| applied.project.owner.id | +bool | +通知主体的迁移项目拥有者id | +
| applied.project.owner.type | +string | +通知主体的迁移项目拥有者类型 | +
| applied.project.owner.name | +string | +通知主体的迁移项目拥有者昵称 | +
| applied.project.owner.login | +string | +通知主体的迁移项目拥有者标识 | +
| applied.project.owner.image_url | +string | +通知主体的迁移项目拥有者头像 | +
| applied.user.id | +int | +通知主体的迁移创建者的id | +
| applied.user.type | +string | +通知主体的迁移创建者的类型 | +
| applied.user.name | +string | +通知主体的迁移创建者的名称 | +
| applied.user.login | +string | +通知主体的迁移创建者的标识 | +
| applied.user.image_url | +string | +通知主体的迁移创建者头像 | +
| applied_user.id | +int | +通知发起者的id | +
| applied_user.type | +string | +通知发起者的类型 | +
| applied_user.name | +string | +通知发起者的名称 | +
| applied_user.login | +string | +通知发起者的标识 | +
| applied_user.image_url | +string | +通知发起者头像 | +
| applied_type | +string | +通知类型 | +
| name | +string | +通知内容 | +
| viewed | +string | +是否已读,waiting:未读,viewed:已读 | +
| status | +string | +通知状态, canceled:已取消,common: 正常,successed:成功,failure:失败 | +
| time_ago | +string | +通知时间 | +
++返回的JSON示例:
+
{
+ "total_count": 5,
+ "applied_messages": [
{
- "id": 20,
- "trend_type": "PullRequest",
- "action_type": "创建了合并请求",
- "trend_id": 9,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "28天前",
- "name": "33",
- "created_at": "2021-04-29 18:37"
+ "applied": {
+ "project": {
+ "id": 74,
+ "identifier": "hehuisssjssjjsjs",
+ "name": "hehuisssjssjjsjs",
+ "description": "wwww",
+ "is_public": false,
+ "owner": {
+ "id": 10,
+ "type": "User",
+ "name": "testforge1",
+ "login": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
+ }
+ },
+ "user": {
+ "id": 6,
+ "type": "User",
+ "name": "何慧",
+ "login": "yystopf",
+ "image_url": "images/avatars/User/6?t=1622513134"
+ },
+ "id": 6,
+ "status": "accepted",
+ "created_at": "2021-06-09 16:34",
+ "time_ago": "1分钟前"
+ },
+ "applied_user": {
+ "id": 6,
+ "type": "User",
+ "name": "何慧",
+ "login": "yystopf",
+ "image_url": "images/avatars/User/6?t=1622513134"
+ },
+ "applied_type": "AppliedProject",
+ "name": "已通过你加入【hehuisssjssjjsjs】仓库的申请。",
+ "viewed": "waiting",
+ "status": "successed",
+ "created_at": "2021-06-09 16:34",
+ "time_ago": "1分钟前"
},
{
- "id": 19,
- "trend_type": "PullRequest",
- "action_type": "关闭了合并请求",
- "trend_id": 8,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "28天前",
- "name": "gggg",
- "created_at": "2021-04-29 17:51"
+ "applied": {
+ "project": {
+ "id": 86,
+ "identifier": "ceshi_repo1",
+ "name": "测试项目啊1",
+ "description": "二十多",
+ "is_public": true,
+ "owner": {
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
+ }
+ },
+ "user": {
+ "id": 6,
+ "type": "User",
+ "name": "yystopf",
+ "login": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ },
+ "owner": {
+ "id": 9,
+ "type": "Organization",
+ "name": "测试组织",
+ "login": "ceshi_org",
+ "image_url": "images/avatars/Organization/9?t=1612706073"
+ },
+ "id": 4,
+ "status": "common",
+ "created_at": "2021-04-26 09:54",
+ "time_ago": "35分钟前"
+ },
+ "applied_user": {
+ "id": 6,
+ "type": "User",
+ "name": "yystopf",
+ "login": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ },
+ "applied_type": "AppliedTransferProject",
+ "name": "正在将【测试项目啊1】仓库转移给【测试组织】",
+ "viewed": "viewed",
+ "status": "common",
+ "created_at": "2021-04-26 09:54",
+ "time_ago": "35分钟前"
},
+ ...
+ ]
+}
+待办事项-接受仓库
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/applied_transfer_projects.json
+await octokit.request('GET /api/users/:login/applied_transfer_projects.json')
+GET /api/users/:login/applied_transfer_projects.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| login | +string | +用户标识 | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| id | +int | +迁移id | +
| status | +string | +迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | +
| time_ago | +string | +迁移创建的时间 | +
| project.id | +int | +迁移项目的id | +
| project.identifier | +string | +迁移项目的标识 | +
| project.name | +string | +迁移项目的名称 | +
| project.description | +string | +迁移项目的描述 | +
| project.is_public | +bool | +迁移项目是否公开 | +
| project.owner.id | +bool | +迁移项目拥有者id | +
| project.owner.type | +string | +迁移项目拥有者类型 | +
| project.owner.name | +string | +迁移项目拥有者昵称 | +
| project.owner.login | +string | +迁移项目拥有者标识 | +
| project.owner.image_url | +string | +迁移项目拥有者头像 | +
| user.id | +int | +迁移创建者的id | +
| user.type | +string | +迁移创建者的类型 | +
| user.name | +string | +迁移创建者的名称 | +
| user.login | +string | +迁移创建者的标识 | +
| user.image_url | +string | +迁移创建者头像 | +
| owner.id | +int | +迁移接受者的id | +
| owner.type | +string | +迁移接受者的类型 | +
| owner.name | +string | +迁移接受者的名称 | +
| owner.login | +string | +迁移接受者的标识 | +
| owner.image_url | +string | +迁移接受者头像 | +
++返回的JSON示例:
+
{
+ "total_count": 4,
+ "applied_transfer_projects": [
{
- "id": 16,
- "trend_type": "Issue",
- "action_type": "创建了工单",
- "trend_id": 8,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "1个月前",
- "name": "hjhkj",
- "issue_type": "1",
- "status_id": 1,
- "priority_id": 2,
- "created_at": "2021-04-19 10:52",
- "updated_at": "2021-04-19 10:52",
- "assign_user_name": null,
- "assign_user_login": null,
- "issue_journal_size": 0,
- "issue_journals": []
+ "project": {
+ "id": 86,
+ "identifier": "ceshi_repo1",
+ "name": "测试项目啊1",
+ "description": "二十多",
+ "is_public": true,
+ "owner": {
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
+ }
+ },
+ "user": {
+ "id": 6,
+ "type": "User",
+ "name": "yystopf",
+ "login": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ },
+ "owner": {
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
+ },
+ "id": 1,
+ "status": "canceled",
+ "created_at": "2021-04-25 18:06",
+ "time_ago": "16小时前"
},
+ ...
+ ]
+}
+用户接受迁移
+ +++示例:
+
curl -X POST http://localhost:3000/api/users/yystopf/applied_transfer_projects/2/accept.json
+await octokit.request('GET /api/users/:login/applied_transfer_projects/:id/accept.json')
+GET /api/users/:login/applied_transfer_projects/:id/accept.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| login | +string | +用户标识 | +
| id | +int | +迁移id | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| id | +int | +迁移id | +
| status | +string | +迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | +
| time_ago | +string | +迁移创建的时间 | +
| project.id | +int | +迁移项目的id | +
| project.identifier | +string | +迁移项目的标识 | +
| project.name | +string | +迁移项目的名称 | +
| project.description | +string | +迁移项目的描述 | +
| project.is_public | +bool | +迁移项目是否公开 | +
| project.owner.id | +bool | +迁移项目拥有者id | +
| project.owner.type | +string | +迁移项目拥有者类型 | +
| project.owner.name | +string | +迁移项目拥有者昵称 | +
| project.owner.login | +string | +迁移项目拥有者标识 | +
| project.owner.image_url | +string | +迁移项目拥有者头像 | +
| user.id | +int | +迁移创建者的id | +
| user.type | +string | +迁移创建者的类型 | +
| user.name | +string | +迁移创建者的名称 | +
| user.login | +string | +迁移创建者的标识 | +
| user.image_url | +string | +迁移创建者头像 | +
| owner.id | +int | +迁移接受者的id | +
| owner.type | +string | +迁移接受者的类型 | +
| owner.name | +string | +迁移接受者的名称 | +
| owner.login | +string | +迁移接受者的标识 | +
| owner.image_url | +string | +迁移接受者头像 | +
++返回的JSON示例:
+
{
+ "project": {
+ "id": 86,
+ "identifier": "ceshi_repo1",
+ "name": "测试项目啊1",
+ "description": "二十多",
+ "is_public": true,
+ "owner": {
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
+ }
+ },
+ "user": {
+ "id": 6,
+ "type": "User",
+ "name": "yystopf",
+ "login": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ },
+ "owner": {
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
+ },
+ "id": 1,
+ "status": "canceled",
+ "created_at": "2021-04-25 18:06",
+ "time_ago": "16小时前"
+}
+用户拒绝迁移
+ +++示例:
+
curl -X POST http://localhost:3000/api/users/yystopf/applied_transfer_projects/2/refuse.json
+await octokit.request('GET /api/users/:login/applied_transfer_projects/:id/refuse.json')
+GET /api/users/:login/applied_transfer_projects/:id/refuse.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| login | +string | +用户标识 | +
| id | +int | +迁移id | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| id | +int | +迁移id | +
| status | +string | +迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | +
| time_ago | +string | +迁移创建的时间 | +
| project.id | +int | +迁移项目的id | +
| project.identifier | +string | +迁移项目的标识 | +
| project.name | +string | +迁移项目的名称 | +
| project.description | +string | +迁移项目的描述 | +
| project.is_public | +bool | +迁移项目是否公开 | +
| project.owner.id | +bool | +迁移项目拥有者id | +
| project.owner.type | +string | +迁移项目拥有者类型 | +
| project.owner.name | +string | +迁移项目拥有者昵称 | +
| project.owner.login | +string | +迁移项目拥有者标识 | +
| project.owner.image_url | +string | +迁移项目拥有者头像 | +
| user.id | +int | +迁移创建者的id | +
| user.type | +string | +迁移创建者的类型 | +
| user.name | +string | +迁移创建者的名称 | +
| user.login | +string | +迁移创建者的标识 | +
| user.image_url | +string | +迁移创建者头像 | +
| owner.id | +int | +迁移接受者的id | +
| owner.type | +string | +迁移接受者的类型 | +
| owner.name | +string | +迁移接受者的名称 | +
| owner.login | +string | +迁移接受者的标识 | +
| owner.image_url | +string | +迁移接受者头像 | +
++返回的JSON示例:
+
{
+ "project": {
+ "id": 86,
+ "identifier": "ceshi_repo1",
+ "name": "测试项目啊1",
+ "description": "二十多",
+ "is_public": true,
+ "owner": {
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
+ }
+ },
+ "user": {
+ "id": 6,
+ "type": "User",
+ "name": "yystopf",
+ "login": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ },
+ "owner": {
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
+ },
+ "id": 1,
+ "status": "canceled",
+ "created_at": "2021-04-25 18:06",
+ "time_ago": "16小时前"
+}
+待办事项-项目申请
+ +++示例:
+
curl -X GET http://localhost:3000/api/users/yystopf/applied_projects.json
+await octokit.request('GET /api/users/:login/applied_projects.json')
+GET /api/users/:login/applied_projects.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| login | +string | +用户标识 | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| id | +int | +申请id | +
| status | +string | +申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝 | +
| time_ago | +string | +申请创建的时间 | +
| project.id | +int | +申请项目的id | +
| project.identifier | +string | +申请项目的标识 | +
| project.name | +string | +申请项目的名称 | +
| project.description | +string | +申请项目的描述 | +
| project.is_public | +bool | +申请项目是否公开 | +
| project.owner.id | +bool | +申请项目拥有者id | +
| project.owner.type | +string | +申请项目拥有者类型 | +
| project.owner.name | +string | +申请项目拥有者昵称 | +
| project.owner.login | +string | +申请项目拥有者标识 | +
| project.owner.image_url | +string | +申请项目拥有者头像 | +
| user.id | +int | +申请创建者的id | +
| user.type | +string | +申请创建者的类型 | +
| user.name | +string | +申请创建者的名称 | +
| user.login | +string | +申请创建者的标识 | +
| user.image_url | +string | +申请创建者头像 | +
++返回的JSON示例:
+
{
+ "total_count": 4,
+ "applied_transfer_projects": [
{
+ "project": {
+ "id": 74,
+ "identifier": "hehuisssjssjjsjs",
+ "name": "hehuisssjssjjsjs",
+ "description": "wwww",
+ "is_public": false,
+ "owner": {
+ "id": 10,
+ "type": "User",
+ "name": "testforge1",
+ "login": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
+ }
+ },
+ "user": {
+ "id": 6,
+ "type": "User",
+ "name": "何慧",
+ "login": "yystopf",
+ "image_url": "images/avatars/User/6?t=1622513134"
+ },
"id": 7,
- "trend_type": "VersionRelease",
- "action_type": "创建了版本发布",
- "trend_id": 7,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "1个月前",
- "name": "v3.0.1",
- "tag_name": "v3.0.1",
- "target_commitish": "master",
- "tarball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v3.0.1.tar.gz",
- "zipball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v3.0.1.zip",
- "url": "http://localhost:10080/api/v1/repos/yystopf/ceshirepo1/releases/78",
- "version_gid": "78",
- "created_at": "2021-03-30 15:51"
- },
- {
- "id": 6,
- "trend_type": "VersionRelease",
- "action_type": "创建了版本发布",
- "trend_id": 6,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "1个月前",
- "name": "v3.0.0",
- "tag_name": "v3.0.0",
- "target_commitish": "master",
- "tarball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v3.0.0.tar.gz",
- "zipball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v3.0.0.zip",
- "url": "http://localhost:10080/api/v1/repos/yystopf/ceshirepo1/releases/77",
- "version_gid": "77",
- "created_at": "2021-03-30 15:33"
- },
- {
- "id": 5,
- "trend_type": "VersionRelease",
- "action_type": "创建了版本发布",
- "trend_id": 5,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "1个月前",
- "name": "v1.0.0",
- "tag_name": "v1.0.0",
- "target_commitish": "master",
- "tarball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v1.0.0.tar.gz",
- "zipball_url": "http://localhost:10080/yystopf/ceshirepo1/archive/v1.0.0.zip",
- "url": "http://localhost:10080/api/v1/repos/yystopf/ceshirepo1/releases/76",
- "version_gid": "76",
- "created_at": "2021-03-30 15:27"
- },
- {
- "id": 2,
- "trend_type": "VersionRelease",
- "action_type": "创建了版本发布",
- "trend_id": 2,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "2个月前",
- "name": "vvvv",
- "tag_name": "v1.1",
- "target_commitish": "dev",
- "tarball_url": "http://localhost:10080/yystopf/virus_blog/archive/v1.1.tar.gz",
- "zipball_url": "http://localhost:10080/yystopf/virus_blog/archive/v1.1.zip",
- "url": "http://localhost:10080/api/v1/repos/yystopf/virus_blog/releases/6",
- "version_gid": "6",
- "created_at": "2021-03-15 14:18"
+ "status": "common",
+ "created_at": "2021-06-09 16:41",
+ "time_ago": "7分钟前"
},
- {
- "id": 2,
- "trend_type": "PullRequest",
- "action_type": "创建了合并请求",
- "trend_id": 2,
- "user_name": "yystopf",
- "user_login": "yystopf",
- "user_avatar": "system/lets/letter_avatars/2/Y/241_125_89/120.png",
- "action_time": "3个月前",
- "name": "444",
- "created_at": "2021-02-25 17:31"
+ ...
+ ]
+}
+用户接受申请
+ +++示例:
+
curl -X POST http://localhost:3000/api/users/yystopf/applied_projects/2/accept.json
+await octokit.request('GET /api/users/:login/applied_projects/:id/accept.json')
+GET /api/users/:login/applied_projects/:id/accept.json
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| login | +string | +用户标识 | +
| id | +int | +申请id | +
| 参数 | +类型 | +字段说明 | +
|---|---|---|
| id | +int | +申请id | +
| status | +string | +申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝 | +
| time_ago | +string | +申请创建的时间 | +
| project.id | +int | +申请项目的id | +
| project.identifier | +string | +申请项目的标识 | +
| project.name | +string | +申请项目的名称 | +
| project.description | +string | +申请项目的描述 | +
| project.is_public | +bool | +申请项目是否公开 | +
| project.owner.id | +bool | +申请项目拥有者id | +
| project.owner.type | +string | +申请项目拥有者类型 | +
| project.owner.name | +string | +申请项目拥有者昵称 | +
| project.owner.login | +string | +申请项目拥有者标识 | +
| project.owner.image_url | +string | +申请项目拥有者头像 | +
| user.id | +int | +申请创建者的id | +
| user.type | +string | +申请创建者的类型 | +
| user.name | +string | +申请创建者的名称 | +
| user.login | +string | +申请创建者的标识 | +
| user.image_url | +string | +申请创建者头像 | +
++返回的JSON示例:
+
{
+ "project": {
+ "id": 74,
+ "identifier": "hehuisssjssjjsjs",
+ "name": "hehuisssjssjjsjs",
+ "description": "wwww",
+ "is_public": false,
+ "owner": {
+ "id": 10,
+ "type": "User",
+ "name": "testforge1",
+ "login": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
}
- ]
+ },
+ "user": {
+ "id": 6,
+ "type": "User",
+ "name": "何慧",
+ "login": "yystopf",
+ "image_url": "images/avatars/User/6?t=1622513134"
+ },
+ "id": 7,
+ "status": "accept",
+ "created_at": "2021-06-09 16:41",
+ "time_ago": "7分钟前"
}
-用户开发能力, 默认为所有时间下的开发能力
+用户拒绝申请
-示例:
curl -X GET http://localhost:3000/api/users/yystopf/statistics/develop.json
-await octokit.request('GET /api/users/:login/statistics/develop.json')
-GET /api/users/:login/statistics/develop.json
curl -X POST http://localhost:3000/api/users/yystopf/applied_projects/2/refuse.json
+await octokit.request('GET /api/users/:login/applied_projects/:id/refuse.json')
+GET /api/users/:login/applied_projects/:id/refuse.json
| 参数 | @@ -1913,17 +3871,17 @@ Success — a happy kitten is an authenticated kitten!|||||
|---|---|---|---|---|---|
| start_time | -integer | -时间戳,开始时间,格式:1621526400 | +login | +string | +用户标识 |
| end_time | -integer | -时间戳,结束时间,格式:1622131200 | +id | +int | +申请id |
| 参数 | @@ -1932,39 +3890,94 @@ Success — a happy kitten is an authenticated kitten!|||||
|---|---|---|---|---|---|
| influence | +id | int | -影响力 | +申请id | |
| contribution | -int | -贡献度 | +status | +string | +申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝 |
| activity | -int | -活跃度 | +time_ago | +string | +申请创建的时间 |
| experience | +project.id | int | -项目经验 | +申请项目的id | |
| language | -int | -语言能力 | +project.identifier | +string | +申请项目的标识 |
| languages_percent | -float | -语言百分比 | +project.name | +string | +申请项目的名称 |
| each_language_score | +project.description | +string | +申请项目的描述 | +||
| project.is_public | +bool | +申请项目是否公开 | +|||
| project.owner.id | +bool | +申请项目拥有者id | +|||
| project.owner.type | +string | +申请项目拥有者类型 | +|||
| project.owner.name | +string | +申请项目拥有者昵称 | +|||
| project.owner.login | +string | +申请项目拥有者标识 | +|||
| project.owner.image_url | +string | +申请项目拥有者头像 | +|||
| user.id | int | -各门语言分数 | +申请创建者的id | +||
| user.type | +string | +申请创建者的类型 | +|||
| user.name | +string | +申请创建者的名称 | +|||
| user.login | +string | +申请创建者的标识 | +|||
| user.image_url | +string | +申请创建者头像 |
返回的JSON示例:
{
- "platform": {
- "influence": 61,
- "contribution": 75,
- "activity": 66,
- "experience": 95,
- "language": 87,
- "languages_percent": {
- "CSS": 0.03,
- "C#": 0.13,
- "Ruby": 0.04,
- "Go": 0.05,
- "C": 0.19,
- "Java": 0.34,
- "Python": 0.09,
- "C+": 0.01,
- "C++": 0.11,
- "Scala": 0.01,
- "HTML": 0.01
- },
- "each_language_score": {
- "CSS": 71,
- "C#": 86,
- "Ruby": 75,
- "Go": 77,
- "C": 90,
- "Java": 93,
- "Python": 83,
- "C+": 66,
- "C++": 85,
- "Scala": 66,
- "HTML": 66
+ "project": {
+ "id": 74,
+ "identifier": "hehuisssjssjjsjs",
+ "name": "hehuisssjssjjsjs",
+ "description": "wwww",
+ "is_public": false,
+ "owner": {
+ "id": 10,
+ "type": "User",
+ "name": "testforge1",
+ "login": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
}
},
"user": {
- "influence": 60,
- "contribution": 72,
- "activity": 65,
- "experience": 88,
- "language": 84,
- "languages_percent": {
- "C": 0.25,
- "C#": 0.33,
- "C++": 0.13,
- "CSS": 0.08,
- "Go": 0.04,
- "HTML": 0.04,
- "Java": 0.04,
- "Ruby": 0.08
- },
- "each_language_score": {
- "C": 81,
- "C#": 84,
- "C++": 75,
- "CSS": 71,
- "Go": 66,
- "HTML": 66,
- "Java": 66,
- "Ruby": 71
- }
- }
+ "id": 6,
+ "type": "User",
+ "name": "何慧",
+ "login": "yystopf",
+ "image_url": "images/avatars/User/6?t=1622513134"
+ },
+ "id": 7,
+ "status": "accept",
+ "created_at": "2021-06-09 16:41",
+ "time_ago": "7分钟前"
}
-用户角色定位,默认显示所有时间下的角色定位数据
+申请加入项目
+ +++示例:
+
curl -X POST http://localhost:3000/api/applied_projects.json
+await octokit.request('POST /api/appliedr_projects.json')
+POST /api/applied_projects.json
| 参数 | +必选 | +默认 | +类型 | +字段说明 | +
|---|---|---|---|---|
| applied_project.code | +是 | ++ | string | +邀请码 | +
| applied_project.role | +否 | ++ | string | +项目权限,reporter: 报告者, developer: 开发者,manager:管理员 | +
--示例:
+请求的JSON示例
curl -X GET http://localhost:3000/api/users/yystopf/statistics/role.json
-await octokit.request('GET /api/users/:login/statistics/role.json')
-GET /api/users/:login/statistics/role.json
{
+ "applied_project": {
+ "code": "1una34",
+ "role": "developer"
+ }
+}
+| 参数 | @@ -2056,110 +4065,94 @@ Success — a happy kitten is an authenticated kitten!|||||
|---|---|---|---|---|---|
| start_time | -integer | -时间戳,开始时间,格式:1621526400 | +id | +int | +申请id |
| end_time | -integer | -时间戳,结束时间,格式:1622131200 | +status | +string | +申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝 |
| 参数 | -类型 | -字段说明 | +time_ago | +string | +项目申请创建的时间 |
|---|---|---|---|---|---|
| total_projects_count | +project.id | int | -用户所有的项目数量 | +申请项目的id | |
| role.object.count | -int | -用户该语言下的项目数量 | +project.identifier | +string | +申请项目的标识 |
| role.object.percent | -float | -用户该语言下的项目占比 | +project.name | +string | +申请项目的名称 |
--返回的JSON示例:
-
{
- "total_projects_count": 27,
- "role": {
- "owner": {
- "count": 24,
- "percent": 0.89
- },
- "manager": {
- "count": 1,
- "percent": 0.04
- },
- "developer": {
- "count": 2,
- "percent": 0.07
- },
- "reporter": {
- "count": 0,
- "percent": 0.0
- }
- }
-}
-用户专业定位,默认显示所有时间下的专业定位数据
- ---示例:
-
curl -X GET http://localhost:3000/api/users/yystopf/statistics/major.json
-await octokit.request('GET /api/users/:login/statistics/major.json')
-GET /api/users/:login/statistics/major.json
| 参数 | -类型 | -字段说明 | +project.description | +string | +申请项目的描述 |
|---|---|---|---|---|---|
| start_time | -integer | -时间戳,开始时间,格式:1621526400 | +project.is_public | +bool | +申请项目是否公开 |
| end_time | -integer | -时间戳,结束时间,格式:1622131200 | +project.owner.id | +bool | +申请项目拥有者id |
| 参数 | -类型 | -字段说明 | +project.owner.type | +string | +申请项目拥有者类型 |
|---|---|---|---|---|---|
| categories | +project.owner.name | +string | +申请项目拥有者昵称 | +||
| project.owner.login | +string | +申请项目拥有者标识 | +|||
| project.owner.image_url | +string | +申请项目拥有者头像 | +|||
| user.id | int | -用户项目分类 | +申请创建者的id | +||
| user.type | +string | +申请创建者的类型 | +|||
| user.name | +string | +申请创建者的名称 | +|||
| user.login | +string | +申请创建者的标识 | +|||
| user.image_url | +string | +申请创建者头像 |
返回的JSON示例:
{
- "categories": [
- "大数据",
- "机器学习",
- "深度学习",
- "人工智能",
- "智慧医疗",
- "云计算"
- ]
+ "project": {
+ "id": 74,
+ "identifier": "hehuisssjssjjsjs",
+ "name": "hehuisssjssjjsjs",
+ "description": "wwww",
+ "is_public": false,
+ "owner": {
+ "id": 10,
+ "type": "User",
+ "name": "testforge1",
+ "login": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
+ }
+ },
+ "user": {
+ "id": 6,
+ "type": "User",
+ "name": "何慧",
+ "login": "yystopf",
+ "image_url": "images/avatars/User/6?t=1622513134"
+ },
+ "id": 7,
+ "status": "common",
+ "created_at": "2021-06-09 16:41",
+ "time_ago": "1分钟前"
}
-待办事项-用户通知信息
+获取项目列表,也可以更加相关条件过滤搜素
-示例:
curl -X GET http://localhost:3000/api/users/yystopf/applied_messages.json
-await octokit.request('GET /api/users/:login/applied_messages.json')
-GET /api/users/:login/applied_messages.json
curl -X GET \
+-d "page=1" \
+-d "limit=5" \
+http://localhost:3000/api/projects | jq
+await octokit.request('GET /api/projects')
+GET api/projects
| 参数 | +必选 | +默认 | 类型 | 字段说明 | |
|---|---|---|---|---|---|
| login | +page | +false | +1 | string | -用户标识 | -
| 参数 | -类型 | -字段说明 | +页数,第几页 | ||||
|---|---|---|---|---|---|---|---|
| applied | -object | -通知主体 | +limit | +false | +15 | +string | +每页多少条数据,默认15条 |
| applied.id | -int | -通知主体的迁移id | +sort_by | +false | ++ | string | +排序类型, 取值:updated_on、created_on、forked_count、praises_count; updated_on: 更新时间排序,created_on: 创建时间排序,forked_count: fork数据排序,praises_count: 点赞数量排序,默认为updated_on更新时间排序 |
| applied.status | +sort_direction | +false | +string | -通知主体的迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | +排序方式,取值为: desc、asc; desc: 降序排序, asc: 升序排序, 默认为:desc | ||
| applied.time_ago | +search | +false | +string | -通知主体的迁移创建的时间 | +按照项目名称搜索 | ||
| applied.project.id | +category_id | +false | +int | -通知主体的迁移项目的id | -|||
| applied.project.identifier | -string | -通知主体的迁移项目的标识 | +项目类别id | ||||
| applied.project.name | -string | -通知主体的迁移项目的名称 | +language_id | +false | ++ | int | +项目语言id |
| applied.project.description | +project_type | +false | +string | -通知主体的迁移项目的描述 | -|||
| applied.project.is_public | -bool | -通知主体的迁移项目是否公开 | +项目类型, 取值为:common、mirror; common:开源托管项目, mirror:开源镜像项目 |
| applied.project.owner.id | -bool | -通知主体的迁移项目拥有者id | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| applied.project.owner.type | -string | -通知主体的迁移项目拥有者类型 | +total_count | +int | +项目总条数 |
| applied.project.owner.name | +id | string | -通知主体的迁移项目拥有者昵称 | +项目id | |
| applied.project.owner.login | +name | string | -通知主体的迁移项目拥有者标识 | +项目名称 | |
| applied.project.owner.image_url | +description | string | -通知主体的迁移项目拥有者头像 | +项目简介 | |
| applied.user.id | +visits | int | -通知主体的迁移创建者的id | +流量数 | |
| applied.user.type | -string | -通知主体的迁移创建者的类型 | +forked_count | +int | +被fork的数量 |
| applied.user.name | -string | -通知主体的迁移创建者的名称 | +praises_count | +int | +star数量 |
| applied.user.login | -string | -通知主体的迁移创建者的标识 | +is_public | +boolean | +是否公开, true:公开,false:未公开 |
| applied.user.image_url | +mirror_url | string | -通知主体的迁移创建者头像 | +镜像url | |
| applied_user.id | +last_update_time | int | -通知发起者的id | -||
| applied_user.type | -string | -通知发起者的类型 | +最后更新时间,为UNIX格式的时间戳 | ||
| applied_user.name | -string | -通知发起者的名称 | +author | +object | +项目创建者 |
| applied_user.login | +-- name | string | -通知发起者的标识 | +用户名,也是用户标识 | |
| applied_user.image_url | -string | -通知发起者头像 | +category | +object | +项目类别 |
| applied_type | -string | -通知类型 | +-- id | +int | +项目类型id |
| name | +-- name | string | -通知内容 | +项目类型名称 | |
| viewed | -string | -是否已读,waiting:未读,viewed:已读 | +language | +object | +项目语言 |
| status | -string | -通知状态, canceled:已取消,common: 正常,successed:成功,failure:失败 | +-- id | +int | +项目语言id |
| time_ago | +-- name | string | -通知时间 | +项目语言名称 |
返回的JSON示例:
{
- "total_count": 5,
- "applied_messages": [
- {
- "applied": {
- "project": {
- "id": 74,
- "identifier": "hehuisssjssjjsjs",
- "name": "hehuisssjssjjsjs",
- "description": "wwww",
- "is_public": false,
- "owner": {
- "id": 10,
- "type": "User",
- "name": "testforge1",
- "login": "testforge1",
- "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "何慧",
- "login": "yystopf",
- "image_url": "images/avatars/User/6?t=1622513134"
- },
- "id": 6,
- "status": "accepted",
- "created_at": "2021-06-09 16:34",
- "time_ago": "1分钟前"
- },
- "applied_user": {
- "id": 6,
- "type": "User",
- "name": "何慧",
- "login": "yystopf",
- "image_url": "images/avatars/User/6?t=1622513134"
- },
- "applied_type": "AppliedProject",
- "name": "已通过你加入【hehuisssjssjjsjs】仓库的申请。",
- "viewed": "waiting",
- "status": "successed",
- "created_at": "2021-06-09 16:34",
- "time_ago": "1分钟前"
- },
- {
- "applied": {
- "project": {
- "id": 86,
- "identifier": "ceshi_repo1",
- "name": "测试项目啊1",
- "description": "二十多",
- "is_public": true,
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "yystopf",
- "login": "yystopf",
- "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
- },
- "owner": {
- "id": 9,
- "type": "Organization",
- "name": "测试组织",
- "login": "ceshi_org",
- "image_url": "images/avatars/Organization/9?t=1612706073"
- },
- "id": 4,
- "status": "common",
- "created_at": "2021-04-26 09:54",
- "time_ago": "35分钟前"
- },
- "applied_user": {
- "id": 6,
- "type": "User",
- "name": "yystopf",
- "login": "yystopf",
- "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
- },
- "applied_type": "AppliedTransferProject",
- "name": "正在将【测试项目啊1】仓库转移给【测试组织】",
- "viewed": "viewed",
- "status": "common",
- "created_at": "2021-04-26 09:54",
- "time_ago": "35分钟前"
- },
- ...
- ]
+ "total_count": 3096,
+ "projects": [
+ {
+ "id": 1400794,
+ "repo_id": 1402452,
+ "identifier": "cscw_2021_sponsor",
+ "name": "Sponsor机制下的开源贡献",
+ "description": "CSCW 2021 sponsor机制研究",
+ "visits": 5,
+ "praises_count": 0,
+ "forked_count": 0,
+ "is_public": true,
+ "mirror_url": null,
+ "type": 0,
+ "last_update_time": 1611971671,
+ "time_ago": "2天前",
+ "forked_from_project_id": null,
+ "open_devops": false,
+ "platform": "forge",
+ "author": {
+ "name": "张迅晖",
+ "login": "Nigel",
+ "image_url": "images/avatars/User/3675?t=1611832880"
+ },
+ "category": {
+ "id": 13,
+ "name": "云计算和大数据"
+ },
+ "language": {
+ "id": 34,
+ "name": "Python3.6"
+ }
+ }
+ ]
}
-待办事项-接受仓库
+ + +获取推荐项目列表
-示例:
curl -X GET http://localhost:3000/api/users/yystopf/applied_transfer_projects.json
-await octokit.request('GET /api/users/:login/applied_transfer_projects.json')
-GET /api/users/:login/applied_transfer_projects.json
| 参数 | -类型 | -字段说明 | -
|---|---|---|
| login | -string | -用户标识 | -
curl -X GET \
+http://localhost:3000/api/projects/recommend | jq
+await octokit.request('GET /api/projects/recommend.json')
+GET api/projects/recommend
| 参数 | @@ -2492,367 +4429,336 @@ Success — a happy kitten is an authenticated kitten!|||||
|---|---|---|---|---|---|
| id | -int | -迁移id | -|||
| status | -string | -迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | -|||
| time_ago | -string | -迁移创建的时间 | -|||
| project.id | +total_count | int | -迁移项目的id | +项目总条数 | |
| project.identifier | +id | string | -迁移项目的标识 | +项目id | |
| project.name | +name | string | -迁移项目的名称 | +项目名称 | |
| project.description | +description | string | -迁移项目的描述 | -||
| project.is_public | -bool | -迁移项目是否公开 | +项目简介 | ||
| project.owner.id | -bool | -迁移项目拥有者id | +visits | +int | +流量数 |
| project.owner.type | -string | -迁移项目拥有者类型 | +forked_count | +int | +被fork的数量 |
| project.owner.name | -string | -迁移项目拥有者昵称 | +praises_count | +int | +star数量 |
| project.owner.login | -string | -迁移项目拥有者标识 | +is_public | +boolean | +是否公开, true:公开,false:未公开 |
| project.owner.image_url | +mirror_url | string | -迁移项目拥有者头像 | +镜像url | |
| user.id | +last_update_time | int | -迁移创建者的id | -||
| user.type | -string | -迁移创建者的类型 | +最后更新时间,为UNIX格式的时间戳 | ||
| user.name | -string | -迁移创建者的名称 | +author | +object | +项目创建者 |
| user.login | +-- name | string | -迁移创建者的标识 | +用户名,也是用户标识 | |
| user.image_url | -string | -迁移创建者头像 | +category | +object | +项目类别 |
| owner.id | +-- id | int | -迁移接受者的id | +项目类型id | |
| owner.type | +-- name | string | -迁移接受者的类型 | +项目类型名称 | |
| owner.name | -string | -迁移接受者的名称 | +language | +object | +项目语言 |
| owner.login | -string | -迁移接受者的标识 | +-- id | +int | +项目语言id |
| owner.image_url | +-- name | string | -迁移接受者头像 | +项目语言名称 |
-返回的JSON示例:
{
- "total_count": 4,
- "applied_transfer_projects": [
- {
- "project": {
- "id": 86,
- "identifier": "ceshi_repo1",
- "name": "测试项目啊1",
- "description": "二十多",
- "is_public": true,
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "yystopf",
- "login": "yystopf",
- "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
- },
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
- },
- "id": 1,
- "status": "canceled",
- "created_at": "2021-04-25 18:06",
- "time_ago": "16小时前"
- },
- ...
- ]
-}
-用户接受迁移
+[
+ {
+ "id": 20,
+ "repo_id": 2,
+ "identifier": "PNAekinmH",
+ "name": "FNILL",
+ "visits": 13567,
+ "author": {
+ "name": "王一达",
+ "login": "wangyida",
+ "image_url": "avatars/User/b"
+ },
+ "category": {
+ "id": 8,
+ "name": "其他"
+ }
+ }
+]
+获取项目导航信息
-示例:
curl -X POST http://localhost:3000/api/users/yystopf/applied_transfer_projects/2/accept.json
-await octokit.request('GET /api/users/:login/applied_transfer_projects/:id/accept.json')
-GET /api/users/:login/applied_transfer_projects/:id/accept.json
| 参数 | -类型 | -字段说明 | -
|---|---|---|
| login | -string | -用户标识 | -
| id | -int | -迁移id | -
curl -X GET \
+http://localhost:3000/api/yystopf/ceshi/menu_list | jq
+await octokit.request('GET /api/yystopf/ceshi/menu_list')
+GET api/:owner/:repo/menu_list
| 参数 | +必选 | +默认 | 类型 | 字段说明 | ||
|---|---|---|---|---|---|---|
| id | -int | -迁移id | -||||
| status | -string | -迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | -||||
| time_ago | -string | -迁移创建的时间 | -||||
| project.id | -int | -迁移项目的id | -||||
| project.identifier | -string | -迁移项目的标识 | -||||
| project.name | -string | -迁移项目的名称 | -||||
| project.description | -string | -迁移项目的描述 | -||||
| project.is_public | -bool | -迁移项目是否公开 | -||||
| project.owner.id | -bool | -迁移项目拥有者id | -||||
| project.owner.type | +owner | +是 | +string | -迁移项目拥有者类型 | +用户登录名 | |
| project.owner.name | +repo | +是 | +string | -迁移项目拥有者昵称 | +项目标识identifier |
| project.owner.login | -string | -迁移项目拥有者标识 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| project.owner.image_url | +menu_name | string | -迁移项目拥有者头像 | +导航名称, home:主页,code:代码库,issues:易修,pulls:合并请求,devops:工作流,versions:里程碑,activity:动态,setting:仓库设置 |
++返回的JSON示例:
+
[
+ {
+ "menu_name": "home"
+ },
+ {
+ "menu_name": "code"
+ },
+ {
+ "menu_name": "pulls"
+ },
+ {
+ "menu_name": "activity"
+ }
+]
+获取项目主页信息
+ +++示例:
+
curl -X GET \
+http://localhost:3000/api/jasder/forgeplus/about | jq
+await octokit.request('GET /api/jasder/forgeplus/about')
+GET api/:owner/:repo/about
| user.id | -int | -迁移创建者的id | +参数 | +必选 | +默认 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| user.type | +owner | +是 | +string | -迁移创建者的类型 | +用户登录名 | ||
| user.name | +repo | +是 | +string | -迁移创建者的名称 | +项目标识identifier |
| user.login | -string | -迁移创建者的标识 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| user.image_url | +identifier | string | -迁移创建者头像 | -||
| owner.id | -int | -迁移接受者的id | +project's identifier | ||
| owner.type | +content | string | -迁移接受者的类型 | +主页内容 | |
| owner.name | -string | -迁移接受者的名称 | +attachments | +array | +附件 |
++返回的JSON示例:
+
{
+ "content": "",
+ "identifier": "forgeplus",
+ attachments: []
+}
+项目模块信息
+ +++示例:
+
curl -X GET \
+http://localhost:3000/api/yystopf/ceshi/project_units.json
+await octokit.request('GET /api/yystopf/ceshi/project_units')
+GET /api/yystopf/ceshi/project_units
| owner.login | -string | -迁移接受者的标识 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| owner.image_url | +type | string | -迁移接受者头像 | +模块名称 |
-返回的JSON示例:
{
- "project": {
- "id": 86,
- "identifier": "ceshi_repo1",
- "name": "测试项目啊1",
- "description": "二十多",
- "is_public": true,
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "yystopf",
- "login": "yystopf",
- "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+[
+ {
+ "type": "code"
},
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
+ {
+ "type": "pulls"
},
- "id": 1,
- "status": "canceled",
- "created_at": "2021-04-25 18:06",
- "time_ago": "16小时前"
-}
-
用户拒绝迁移
-用户拒绝迁移
+ {
+ "type": "issues"
+ }
+]
+更改项目模块展示
-示例:
curl -X POST http://localhost:3000/api/users/yystopf/applied_transfer_projects/2/refuse.json
-await octokit.request('GET /api/users/:login/applied_transfer_projects/:id/refuse.json')
-GET /api/users/:login/applied_transfer_projects/:id/refuse.json
curl -X POST \
+-H "accept: application/json" \
+-H "Content-Type: application/json" \
+-d "{ \"unit_typs\": [\"code\", \"pulls\"]}" \
+http://localhost:3000/api/yystopf/ceshi/project_units.json
+await octokit.request('POST /api/yystopf/ceshi/project_units')
+POST /api/yystopf/ceshi/project_units
| 参数 | +必选 | +默认 | +类型 | +字段说明 | +
|---|---|---|---|---|
| unit_types | +是 | ++ | array | +项目模块内容, 支持以下参数:code:代码库,issues:易修,pulls:合并请求,devops:工作流,versions:里程碑 | +
| 参数 | @@ -2861,138 +4767,266 @@ Success — a happy kitten is an authenticated kitten!|||||
|---|---|---|---|---|---|
| login | -string | -用户标识 | +status | +int | +返回状态, 0: 表示操作成功 |
| id | -int | -迁移id | +message | +string | +返回信息说明 |
++返回的JSON示例:
+
{
+ "status": 0,
+ "message": "success"
+}
+创建项目
+ +++示例:
+
curl -X POST \
+-d "user_id=36401" \
+-d "name=hnfl_demo" \
+-d "description=my first project" \
+-d "repository_name=hnfl_demo" \
+-d "project_category_id=1" \
+-d "project_language_id=2" \
+-d "ignore_id=2" \
+-d "license_id=1" \
+http://localhost:3000/api/projects.json
+await octokit.request('GET /api/projects.json')
+POST api/projects
| 参数 | +必选 | +默认 | 类型 | 字段说明 | |||
|---|---|---|---|---|---|---|---|
| id | +user_id | +是 | +int | -迁移id | +用户id或者组织id | ||
| status | +name | +是 | +string | -迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | +项目名称 | ||
| time_ago | +description | +是 | +string | -迁移创建的时间 | +项目描述 | ||
| project.id | -int | -迁移项目的id | +repository_name | +是 | ++ | string | +仓库名称, 只含有数字、字母、下划线不能以下划线开头和结尾,且唯一 |
| project.identifier | -string | -迁移项目的标识 | +project_category_id | +是 | ++ | int | +项目类别id |
| project.name | -string | -迁移项目的名称 | +project_language_id | +是 | ++ | int | +项目语言id |
| project.description | -string | -迁移项目的描述 | +ignore_id | +否 | ++ | int | +gitignore相关id |
| project.is_public | -bool | -迁移项目是否公开 | +license_id | +否 | ++ | int | +开源许可证id |
| project.owner.id | -bool | -迁移项目拥有者id | +private | +否 | ++ | boolean | +项目是否私有, true:为私有,false: 公开,默认为公开 |
| project.owner.type | -string | -迁移项目拥有者类型 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| project.owner.name | -string | -迁移项目拥有者昵称 | +id | +int | +id |
| project.owner.login | +name | string | -迁移项目拥有者标识 | +项目名称 |
++返回的JSON示例:
+
{
+ "id": 3240,
+ "name": "好项目"
+}
+创建镜像项目
+ +++示例:
+
curl -X POST \
+-d "user_id=36408" \
+-d "clone_addr=https://gitea.com/mx8090alex/golden.git" \
+-d "name=golden_mirror1" \
+-d "description=golden_mirror" \
+-d "project_category_id=1" \
+-d "project_language_id=2" \
+http://localhost:3000/api/projects/migrate.json
+await octokit.request('GET /api/projects/migrate.json')
+POST api/projects/migrate.json
| project.owner.image_url | -string | -迁移项目拥有者头像 | +参数 | +必选 | +默认 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| user.id | +user_id | +是 | +int | -迁移创建者的id | +用户id或者组织id | ||
| user.type | +name | +是 | +string | -迁移创建者的类型 | +项目名称 | ||
| user.name | +clone_addr | +是 | +string | -迁移创建者的名称 | +镜像项目clone地址 | ||
| user.login | +description | +否 | +string | -迁移创建者的标识 | +项目描述 | ||
| user.image_url | +repository_name | +是 | +string | -迁移创建者头像 | +仓库名称, 只含有数字、字母、下划线不能以下划线开头和结尾,且唯一 | ||
| owner.id | +project_category_id | +是 | +int | -迁移接受者的id | +项目类别id | ||
| owner.type | +project_language_id | +是 | ++ | int | +项目语言id | +||
| is_mirror | +否 | ++ | boolean | +是否设置为镜像, true:是, false:否,默认为否 | +|||
| auth_username | +否 | +string | -迁移接受者的类型 | +镜像源仓库的登录用户名 | |||
| owner.name | +auth_password | +否 | +string | -迁移接受者的名称 | +镜像源仓库的登录秘密 | +||
| private | +否 | ++ | boolean | +项目是否私有, true:为私有,false: 非私有,默认为公开 | +
| 参数 | +类型 | +字段说明 | |||
|---|---|---|---|---|---|
| owner.login | -string | -迁移接受者的标识 | +id | +int | +id |
| owner.image_url | +name | string | -迁移接受者头像 | +项目名称 |
返回的JSON示例:
{
- "project": {
- "id": 86,
- "identifier": "ceshi_repo1",
- "name": "测试项目啊1",
- "description": "二十多",
- "is_public": true,
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "yystopf",
- "login": "yystopf",
- "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
- },
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
- },
- "id": 1,
- "status": "canceled",
- "created_at": "2021-04-25 18:06",
- "time_ago": "16小时前"
+ "id": 3241,
+ "name": "这是一个镜像项目"
}
-待办事项-项目申请
+手动同步镜像
-示例:
curl -X GET http://localhost:3000/api/users/yystopf/applied_projects.json
-await octokit.request('GET /api/users/:login/applied_projects.json')
-GET /api/users/:login/applied_projects.json
curl -X POST http://localhost:3000/api/repositories/1244/sync_mirror.json
+await octokit.request('POST /api/repositories/1244/sync_mirror.json')
+POST api/repositories/:id/sync_mirror.json
| 参数 | +必选 | +默认 | 类型 | 字段说明 | |||
|---|---|---|---|---|---|---|---|
| login | -string | -用户标识 | +id | +是 | ++ | int | +仓库id |
| 参数 | @@ -3066,163 +5074,224 @@ Success — a happy kitten is an authenticated kitten!||||
|---|---|---|---|---|
| id | -int | -申请id | -||
| status | -string | -申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝 | +int | +状态码, 0:标识请求成功 |
| time_ago | +message | string | -申请创建的时间 | -|
| project.id | -int | -申请项目的id | +服务端返回的信息说明 |
++返回的JSON示例:
+
{
+ "status": 0,
+ "message": "success"
+}
+fork项目
+ +++示例:
+
curl -X POST http://localhost:3000/api/jasder/forgeplus/forks.json
+await octokit.request('POST /api/jaser/jasder_test/forks.json')
+POST api/:owner/:repo/forks.json
| project.identifier | -string | -申请项目的标识 | +参数 | +必选 | +默认 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| project.name | +owner | +是 | +string | -申请项目的名称 | +用户登录名 | ||
| project.description | +repo | +是 | +string | -申请项目的描述 | +项目标识identifier |
| project.is_public | -bool | -申请项目是否公开 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| project.owner.id | -bool | -申请项目拥有者id | +id | +int | +项目id |
| project.owner.type | +identifier | string | -申请项目拥有者类型 | +项目标识 |
++返回的JSON示例:
+
{
+ "id": 3290,
+ "identifier": "newadm"
+}
+用户管理的组织列表
+ +++示例:
+
curl -X GET \
+http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizations.json | jq
+await octokit.request('GET /api/:owner/:repo/applied_transfer_projects/organizations')
+GET api/:owner/:repo/applied_transfer_projects/organizations
| project.owner.name | -string | -申请项目拥有者昵称 | +参数 | +必选 | +默认 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| project.owner.login | +owner | +是 | +string | -申请项目拥有者标识 | +用户登录名 | ||
| project.owner.image_url | +repo | +是 | +string | -申请项目拥有者头像 | +项目标识identifier |
| user.id | -int | -申请创建者的id | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| user.type | +name | string | -申请创建者的类型 | +组织标识 | |
| user.name | +nickname | string | -申请创建者的名称 | +组织名称 | |
| user.login | +description | string | -申请创建者的标识 | +组织描述 | |
| user.image_url | -string | -申请创建者头像 | -
--返回的JSON示例:
-
{
- "total_count": 4,
- "applied_transfer_projects": [
- {
- "project": {
- "id": 74,
- "identifier": "hehuisssjssjjsjs",
- "name": "hehuisssjssjjsjs",
- "description": "wwww",
- "is_public": false,
- "owner": {
- "id": 10,
- "type": "User",
- "name": "testforge1",
- "login": "testforge1",
- "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "何慧",
- "login": "yystopf",
- "image_url": "images/avatars/User/6?t=1622513134"
- },
- "id": 7,
- "status": "common",
- "created_at": "2021-06-09 16:41",
- "time_ago": "7分钟前"
+avatar_url
+string|组织头像
+
+
+
+
+
+返回的JSON示例:
+
+{
+ "total_count": 3,
+ "organizations": [
+ {
+ "id": 9,
+ "name": "ceshi_org",
+ "nickname": "测试组织",
+ "description": "测试组织",
+ "avatar_url": "images/avatars/Organization/9?t=1612706073"
},
- ...
+ {
+ "id": 51,
+ "name": "ceshi",
+ "nickname": "测试组织哈哈哈",
+ "description": "23212312",
+ "avatar_url": "images/avatars/Organization/51?t=1618800723"
+ },
+ {
+ "id": 52,
+ "name": "ceshi1",
+ "nickname": "身份卡手动阀",
+ "description": "1231手动阀是的",
+ "avatar_url": "images/avatars/Organization/52?t=1618805056"
+ }
]
}
-
用户接受申请
-用户接受申请
+迁移项目,edit接口is_transfering为true表示正在迁移
-示例:
curl -X POST http://localhost:3000/api/users/yystopf/applied_projects/2/accept.json
-await octokit.request('GET /api/users/:login/applied_projects/:id/accept.json')
-GET /api/users/:login/applied_projects/:id/accept.json
curl -X POST http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects.json
+await octokit.request('POST /api/:owner/:repo/applied_transfer_projects.json')
+POST /api/:owner/:repo/applied_transfer_projects.json
| 参数 | +必选 | +默认 | 类型 | 字段说明 | |||
|---|---|---|---|---|---|---|---|
| login | +owner | +是 | +string | -用户标识 | +用户登录名 | ||
| id | -int | -申请id | +repo | +是 | ++ | string | +项目标识identifier | +
| owner_name | +是 | ++ | string | +迁移对象标识 |
| 参数 | @@ -3233,92 +5302,117 @@ Success — a happy kitten is an authenticated kitten!|||
|---|---|---|---|
| id | int | -申请id | +项目id |
| status | string | -申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝 | +项目迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 |
| time_ago | string | -申请创建的时间 | +项目迁移创建的时间 |
| project.id | int | -申请项目的id | +迁移项目的id |
| project.identifier | string | -申请项目的标识 | +迁移项目的标识 |
| project.name | string | -申请项目的名称 | +迁移项目的名称 |
| project.description | string | -申请项目的描述 | +迁移项目的描述 |
| project.is_public | bool | -申请项目是否公开 | +迁移项目是否公开 |
| project.owner.id | bool | -申请项目拥有者id | +迁移项目拥有者id |
| project.owner.type | string | -申请项目拥有者类型 | +迁移项目拥有者类型 |
| project.owner.name | string | -申请项目拥有者昵称 | +迁移项目拥有者昵称 |
| project.owner.login | string | -申请项目拥有者标识 | +迁移项目拥有者标识 |
| project.owner.image_url | string | -申请项目拥有者头像 | +迁移项目拥有者头像 |
| user.id | int | -申请创建者的id | +迁移创建者的id |
| user.type | string | -申请创建者的类型 | +迁移创建者的类型 |
| user.name | string | -申请创建者的名称 | +迁移创建者的名称 |
| user.login | string | -申请创建者的标识 | +迁移创建者的标识 |
| user.image_url | string | -申请创建者头像 | +迁移创建者头像 | +
| owner.id | +int | +迁移接受者的id | +|
| owner.type | +string | +迁移接受者的类型 | +|
| owner.name | +string | +迁移接受者的名称 | +|
| owner.login | +string | +迁移接受者的标识 | +|
| owner.image_url | +string | +迁移接受者头像 |
{
"project": {
- "id": 74,
- "identifier": "hehuisssjssjjsjs",
- "name": "hehuisssjssjjsjs",
- "description": "wwww",
- "is_public": false,
+ "id": 86,
+ "identifier": "ceshi_repo1",
+ "name": "测试项目啊1",
+ "description": "二十多",
+ "is_public": true,
"owner": {
- "id": 10,
- "type": "User",
- "name": "testforge1",
- "login": "testforge1",
- "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
}
},
"user": {
"id": 6,
"type": "User",
- "name": "何慧",
+ "name": "yystopf",
"login": "yystopf",
- "image_url": "images/avatars/User/6?t=1622513134"
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
},
- "id": 7,
- "status": "accept",
- "created_at": "2021-06-09 16:41",
- "time_ago": "7分钟前"
+ "owner": {
+ "id": 9,
+ "type": "Organization",
+ "name": "测试组织",
+ "login": "ceshi_org",
+ "image_url": "images/avatars/Organization/9?t=1612706073"
+ },
+ "id": 4,
+ "status": "common",
+ "created_at": "2021-04-26 09:54",
+ "time_ago": "1分钟前"
}
-用户拒绝申请
+迁移项目,edit接口is_transfering为true表示正在迁移
-示例:
curl -X POST http://localhost:3000/api/users/yystopf/applied_projects/2/refuse.json
-await octokit.request('GET /api/users/:login/applied_projects/:id/refuse.json')
-GET /api/users/:login/applied_projects/:id/refuse.json
curl -X POST http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/cancel.json
+await octokit.request('POST /api/:owner/:repo/applied_transfer_projects/cancel.json')
+POST /api/:owner/:repo/applied_transfer_projects/cancel.json
| 参数 | +必选 | +默认 | 类型 | 字段说明 | |||
|---|---|---|---|---|---|---|---|
| login | +owner | +是 | +string | -用户标识 | +用户登录名 | ||
| id | -int | -申请id | +repo | +是 | ++ | string | +项目标识identifier |
| 参数 | @@ -3392,92 +5499,117 @@ Success — a happy kitten is an authenticated kitten!||||
|---|---|---|---|---|
| id | int | -申请id | +迁移id | |
| status | string | -申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝 | +迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | |
| time_ago | string | -申请创建的时间 | +迁移创建的时间 | |
| project.id | int | -申请项目的id | +迁移项目的id | |
| project.identifier | string | -申请项目的标识 | +迁移项目的标识 | |
| project.name | string | -申请项目的名称 | +迁移项目的名称 | |
| project.description | string | -申请项目的描述 | +迁移项目的描述 | |
| project.is_public | bool | -申请项目是否公开 | +迁移项目是否公开 | |
| project.owner.id | bool | -申请项目拥有者id | +迁移项目拥有者id | |
| project.owner.type | string | -申请项目拥有者类型 | +迁移项目拥有者类型 | |
| project.owner.name | string | -申请项目拥有者昵称 | +迁移项目拥有者昵称 | |
| project.owner.login | string | -申请项目拥有者标识 | +迁移项目拥有者标识 | |
| project.owner.image_url | string | -申请项目拥有者头像 | +迁移项目拥有者头像 | |
| user.id | int | -申请创建者的id | +迁移创建者的id | |
| user.type | string | -申请创建者的类型 | +迁移创建者的类型 | +|
| user.name | +string | +迁移创建者的名称 | +||
| user.login | +string | +迁移创建者的标识 | +||
| user.image_url | +string | +迁移创建者头像 | +||
| owner.id | +int | +迁移接受者的id | +||
| owner.type | +string | +迁移接受者的类型 | ||
| user.name | +owner.name | string | -申请创建者的名称 | +迁移接受者的名称 |
| user.login | +owner.login | string | -申请创建者的标识 | +迁移接受者的标识 |
| user.image_url | +owner.image_url | string | -申请创建者头像 | +迁移接受者头像 |
{
"project": {
- "id": 74,
- "identifier": "hehuisssjssjjsjs",
- "name": "hehuisssjssjjsjs",
- "description": "wwww",
- "is_public": false,
+ "id": 86,
+ "identifier": "ceshi_repo1",
+ "name": "测试项目啊1",
+ "description": "二十多",
+ "is_public": true,
"owner": {
- "id": 10,
- "type": "User",
- "name": "testforge1",
- "login": "testforge1",
- "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
+ "id": 52,
+ "type": "Organization",
+ "name": "身份卡手动阀",
+ "login": "ceshi1",
+ "image_url": "images/avatars/Organization/52?t=1618805056"
}
},
"user": {
"id": 6,
"type": "User",
- "name": "何慧",
+ "name": "yystopf",
"login": "yystopf",
- "image_url": "images/avatars/User/6?t=1622513134"
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
},
- "id": 7,
- "status": "accept",
- "created_at": "2021-06-09 16:41",
- "time_ago": "7分钟前"
+ "owner": {
+ "id": 9,
+ "type": "Organization",
+ "name": "测试组织",
+ "login": "ceshi_org",
+ "image_url": "images/avatars/Organization/9?t=1612706073"
+ },
+ "id": 4,
+ "status": "common",
+ "created_at": "2021-04-26 09:54",
+ "time_ago": "1分钟前"
}
-申请加入项目
+仓库详情
-示例:
curl -X POST http://localhost:3000/api/applied_projects.json
-await octokit.request('POST /api/appliedr_projects.json')
+curl -X GET http://localhost:3000/api/jasder/jasder_test.json
+
await octokit.request('GET /api/jasder/jasder_test.json')
HTTP 请求
-POST /api/applied_projects.json
-请求参数
+GET /api/:owner/:repo
+请求参数:
参数
@@ -3532,31 +5671,21 @@ Success — a happy kitten is an authenticated kitten!
-applied_project.code
+owner
是
string
-邀请码
+用户登录名
-applied_project.role
-否
+repo
+是
string
-项目权限,reporter: 报告者, developer: 开发者,manager:管理员
+项目标识identifier
-
-
-请求的JSON示例
-
-{
- "applied_project": {
- "code": "1una34",
- "role": "developer"
- }
-}
-
返回字段说明
+返回字段说明:
参数
@@ -3567,92 +5696,128 @@ Success — a happy kitten is an authenticated kitten!
id
int
-申请id
+id
-status
+name
string
-申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝
+项目名称
-time_ago
+identifier
string
-项目申请创建的时间
+项目标识
-project.id
-int
-申请项目的id
+is_public
+boolean
+项目是否公开, true:公开,false:私有
-project.identifier
+description
string
-申请项目的标识
+项目简介
-project.name
-string
-申请项目的名称
+repo_id
+int
+仓库id
-project.description
+repo_identifier
string
-申请项目的描述
+仓库标识
+
+
+
+返回的JSON示例:
+
+{
+ "name": "ni项目",
+ "identifier": "mirror_demo",
+ "is_public": true,
+ "description": "my first project mirror_demo",
+ "repo_id": 75073,
+ "repo_identifier": "mirror_demo"
+}
+
仓库详情(简版)
+仓库详情
+
+
+示例:
+
+curl -X GET http://localhost:3000/api/jasder/jasder_test/simple.json
+
await octokit.request('GET /api/jasder/jasder_test/simple.json')
+
HTTP 请求
+GET /api/:owner/:repo/simple
+请求参数:
+
-project.is_public
-bool
-申请项目是否公开
+参数
+必选
+默认
+类型
+字段说明
+
-project.owner.id
-bool
-申请项目拥有者id
+owner
+是
+
+string
+用户登录名
-project.owner.type
+repo
+是
+
string
-申请项目拥有者类型
+项目标识identifier
+
+返回字段说明:
+
-project.owner.name
-string
-申请项目拥有者昵称
+参数
+类型
+字段说明
+
-project.owner.login
-string
-申请项目拥有者标识
+id
+int
+id
-project.owner.image_url
+name
string
-申请项目拥有者头像
+项目名称
-user.id
-int
-申请创建者的id
+identifier
+string
+项目标识
-user.type
-string
-申请创建者的类型
+is_public
+boolean
+项目是否公开, true:公开,false:私有
-user.name
+description
string
-申请创建者的名称
+项目简介
-user.login
-string
-申请创建者的标识
+repo_id
+int
+仓库id
-user.image_url
+repo_identifier
string
-申请创建者头像
+仓库标识
@@ -3660,46 +5825,24 @@ Success — a happy kitten is an authenticated kitten!
返回的JSON示例:
{
- "project": {
- "id": 74,
- "identifier": "hehuisssjssjjsjs",
- "name": "hehuisssjssjjsjs",
- "description": "wwww",
- "is_public": false,
- "owner": {
- "id": 10,
- "type": "User",
- "name": "testforge1",
- "login": "testforge1",
- "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "何慧",
- "login": "yystopf",
- "image_url": "images/avatars/User/6?t=1622513134"
- },
- "id": 7,
- "status": "common",
- "created_at": "2021-06-09 16:41",
- "time_ago": "1分钟前"
+ "name": "ni项目",
+ "identifier": "mirror_demo",
+ "is_public": true,
+ "description": "my first project mirror_demo",
+ "repo_id": 75073,
+ "repo_identifier": "mirror_demo"
}
-
获取项目列表
-获取项目列表,也可以更加相关条件过滤搜素
+仓库详情
--示例:
-
curl -X GET \
--d "page=1" \
--d "limit=5" \
-http://localhost:3000/api/projects | jq
-await octokit.request('GET /api/projects')
-GET api/projects
示例:
+ +curl -X GET http://localhost:3000/api/yystopf/ceshi/detail.json
+await octokit.request('GET /api/yystopf/ceshi/detail.json')
+GET /api/:owner/:repo/detail
| 参数 | @@ -3710,421 +5853,369 @@ http://localhost:3000/api/projects | jq||||||||
|---|---|---|---|---|---|---|---|---|
| page | -false | -1 | +owner | +是 | +string | -页数,第几页 | +用户登录名 | |
| limit | -false | -15 | +repo | +是 | +string | -每页多少条数据,默认15条 | +项目标识identifier |
| sort_by | -false | -- | string | -排序类型, 取值:updated_on、created_on、forked_count、praises_count; updated_on: 更新时间排序,created_on: 创建时间排序,forked_count: fork数据排序,praises_count: 点赞数量排序,默认为updated_on更新时间排序 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| sort_direction | -false | -+ | content | string | -排序方式,取值为: desc、asc; desc: 降序排序, asc: 升序排序, 默认为:desc | +仓库简介 | |
| search | -false | -+ | website | string | -按照项目名称搜索 | +仓库网址 | |
| category_id | -false | -- | int | -项目类别id | +readme | +string | +readme文件| |
| language_id | -false | -- | int | -项目语言id | +identifier | +string | +项目标识 |
| project_type | -false | -+ | name | string | -项目类型, 取值为:common、mirror; common:开源托管项目, mirror:开源镜像项目 | +项目名称 |
| 参数 | -类型 | -字段说明 | +issues_count | +int | +项目issue数量 |
|---|---|---|---|---|---|
| total_count | +pull_requests_count | int | -项目总条数 | +项目合并请求数量 | |
| id | -string | -项目id | +project_identifier | +int | +项目标识 |
| name | -string | -项目名称 | +praises_count | +int | +项目点赞数量 |
| description | -string | -项目简介 | +forked_count | +int | +项目复刻数量 |
| visits | +watchers_count | int | -流量数 | +项目关注数量 | |
| forked_count | +versions_count | int | -被fork的数量 | +项目里程碑数量 | |
| praises_count | +version_releases_count | int | -star数量 | +项目发行版数量 | |
| is_public | -boolean | -是否公开, true:公开,false:未公开 | +version_releasesed_count | +int | +项目发行版已发行数量 | +
| permission | +string | +项目权限 | |||
| mirror_url | string | -镜像url | +镜像地址 | ||
| last_update_time | +mirror | +bool | +是否为镜像项目 | +||
| type | int | -最后更新时间,为UNIX格式的时间戳 | +项目类型 0 普通项目 1 普通镜像项目 2 同步镜像项目 | ||
| author | -object | -项目创建者 | +open_devops | +int | +是否开启devops |
| -- name | -string | -用户名,也是用户标识 | +watched | +bool | +是否关注 |
| category | -object | -项目类别 | +praised | +bool | +是否点赞 |
| -- id | +status | int | -项目类型id | +项目状态 | |
| -- name | -string | -项目类型名称 | +forked_from_project_id | +int | +fork项目id |
| language | +fork_info | object | -项目语言 | -||
| -- id | -int | -项目语言id | +fork项目信息 | ||
| -- name | +size | string | -项目语言名称 | +仓库大小 |
--返回的JSON示例:
-
{
- "total_count": 3096,
- "projects": [
- {
- "id": 1400794,
- "repo_id": 1402452,
- "identifier": "cscw_2021_sponsor",
- "name": "Sponsor机制下的开源贡献",
- "description": "CSCW 2021 sponsor机制研究",
- "visits": 5,
- "praises_count": 0,
- "forked_count": 0,
- "is_public": true,
- "mirror_url": null,
- "type": 0,
- "last_update_time": 1611971671,
- "time_ago": "2天前",
- "forked_from_project_id": null,
- "open_devops": false,
- "platform": "forge",
- "author": {
- "name": "张迅晖",
- "login": "Nigel",
- "image_url": "images/avatars/User/3675?t=1611832880"
- },
- "category": {
- "id": 13,
- "name": "云计算和大数据"
- },
- "language": {
- "id": 34,
- "name": "Python3.6"
- }
- }
- ]
-}
-获取推荐项目列表
- ---示例:
-
curl -X GET \
-http://localhost:3000/api/projects/recommend | jq
-await octokit.request('GET /api/projects/recommend.json')
-GET api/projects/recommend
| 参数 | -类型 | -字段说明 | +ssh_url | +string | +项目ssh地址 |
|---|---|---|---|---|---|
| total_count | -int | -项目总条数 | +clone_url | +string | +项目克隆地址 |
| id | +default_branch | string | -项目id | +仓库默认分支 | |
| name | -string | -项目名称 | +empty | +bool | +仓库是否为空 |
| description | +full_name | string | -项目简介 | +仓库全称 | |
| visits | -int | -流量数 | +private | +bool | +仓库是否为私有项目 |
| forked_count | -int | -被fork的数量 | +license_name | +string | +许可证名称 |
| praises_count | -int | -star数量 | +release_versions.list.name | +string | +项目issue数量 |
| is_public | -boolean | -是否公开, true:公开,false:未公开 | +release_versions.list.tag_name | +string | +发行版标签名称 |
| mirror_url | +release_versions.list.created_at | string | -镜像url | +发行版创建时间 | |
| last_update_time | +release_versions.total_count | int | -最后更新时间,为UNIX格式的时间戳 | -||
| author | -object | -项目创建者 | +发行版数量 | ||
| -- name | +branches.list.name | string | -用户名,也是用户标识 | -||
| category | -object | -项目类别 | +分支名称 | ||
| -- id | +branches.total_count | int | -项目类型id | +分支数量 | |
| -- name | +tags.list.name | string | -项目类型名称 | +标签名称 | |
| language | -object | -项目语言 | +tags.total_count | +int | +标签数量 |
| -- id | +contributors.list.contributions | int | -项目语言id | +贡献数量 | |
| -- name | +contributors.list.login | string | -项目语言名称 | -
--返回的JSON示例:
-
[
- {
- "id": 20,
- "repo_id": 2,
- "identifier": "PNAekinmH",
- "name": "FNILL",
- "visits": 13567,
- "author": {
- "name": "王一达",
- "login": "wangyida",
- "image_url": "avatars/User/b"
- },
- "category": {
- "id": 8,
- "name": "其他"
- }
- }
-]
-获取项目导航信息
- ---示例:
-
curl -X GET \
-http://localhost:3000/api/yystopf/ceshi/menu_list | jq
-await octokit.request('GET /api/yystopf/ceshi/menu_list')
-GET api/:owner/:repo/menu_list
| 参数 | -必选 | -默认 | -类型 | -字段说明 | +贡献者登录名 | |
|---|---|---|---|---|---|---|
| owner | -是 | -+ | contributors.list.name | string | -用户登录名 | +贡献者用户名称 |
| repo | -是 | -+ | contributors.list.image_url | string | -项目标识identifier | -
| 参数 | -类型 | -字段说明 | +贡献者头像 | ||
|---|---|---|---|---|---|
| menu_name | -string | -导航名称, home:主页,code:代码库,issues:易修,pulls:合并请求,devops:工作流,versions:里程碑,activity:动态,setting:仓库设置 | +languages | +object | +项目语言占比 |
-返回的JSON示例:
[
- {
- "menu_name": "home"
+{
+ "content": "仓库简介",
+ "website": "仓库网址",
+ "readme": {
+ "type": "file",
+ "encoding": "base64",
+ "size": 9,
+ "name": "README.md",
+ "path": "README.md",
+ "content": "# ceshi\n\n",
+ "sha": ""
},
- {
- "menu_name": "code"
+ "identifier": "ceshi",
+ "name": "测试项目",
+ "project_id": 2,
+ "repo_id": 2,
+ "issues_count": 0,
+ "pull_requests_count": 0,
+ "project_identifier": "ceshi",
+ "praises_count": 0,
+ "forked_count": 0,
+ "watchers_count": 0,
+ "versions_count": 0,
+ "version_releases_count": 0,
+ "version_releasesed_count": 0,
+ "permission": "Reporter",
+ "mirror_url": null,
+ "mirror": false,
+ "type": 0,
+ "open_devops": false,
+ "watched": false,
+ "praised": false,
+ "status": 1,
+ "forked_from_project_id": 1,
+ "fork_info": {
+ "fork_form_name": "测试项目",
+ "fork_project_user_login": "ceshi_org",
+ "fork_project_identifier": "ceshi",
+ "fork_project_user_name": "ceshi_org"
},
- {
- "menu_name": "pulls"
+ "size": "25.0 KB",
+ "ssh_url": "virus@localhost:yystopf/ceshi.git",
+ "clone_url": "http://localhost:10080/yystopf/ceshi.git",
+ "default_branch": "master",
+ "empty": false,
+ "full_name": "yystopf/ceshi",
+ "private": false,
+ "license_name": "gnu-javamail-exception",
+ "release_versions": {
+ "list": [
+ {
+ "id": 2,
+ "name": "vvvv",
+ "tag_name": "v1.1",
+ "created_at": "2019-07-18 10:16"
+ }
+ ],
+ "total_count": 1
},
- {
- "menu_name": "activity"
- }
-]
-
项目主页
-获取项目主页信息
+ "branches": {
+ "list": [
+ {
+ "name": "master"
+ }
+ ],
+ "total_count": 1
+ },
+ "tags": {
+ "list": [
+ {
+ "name": "v1.1"
+ },
+ {
+ "name": "v1.0"
+ }
+ ],
+ "total_count": 2
+ },
+ "contributors": {
+ "list": [
+ {
+ "contributions": 1,
+ "gid": 2,
+ "login": "yystopf",
+ "type": "User",
+ "name": "yystopf",
+ "image_url": "avatars/User/b"
+ }
+ ],
+ "total_count": 1
+ },
+ "languages": {
+ "HTML": "50.9%",
+ "Ruby": "25.6%",
+ "JavaScript": "21.4%",
+ "CSS": "1.3%",
+ "CoffeeScript": "0.7%",
+ "Shell": "0.1%"
+ }
+}
+仓库标签列表
-示例:
curl -X GET \
-http://localhost:3000/api/jasder/forgeplus/about | jq
-await octokit.request('GET /api/jasder/forgeplus/about')
-GET api/:owner/:repo/about
curl -X GET http://localhost:3000/api/yystopf/csfjkkj/tags.json
+await octokit.request('GET /api/yystopf/csfjkkj/tags.json')
+GET /api/:owner/:repo/tags.json
| 参数 | @@ -4148,8 +6239,22 @@ http://localhost:3000/api/jasder/forgeplus/about | jqstring | 项目标识identifier | ||
|---|---|---|---|---|
| page | +否 | +1 | +integer | +页码 | +
| limit | +否 | +20 | +integer | +每页个数 | +
| 参数 | @@ -4158,153 +6263,164 @@ http://localhost:3000/api/jasder/forgeplus/about | jq|||||
|---|---|---|---|---|---|
| identifier | +id | +int | +标签id | +||
| name | string | -project's identifier | +标签名称 | ||
| content | +zipball_url | string | -主页内容 | +标签zip包下载地址 | |
| attachments | -array | -附件 | +tarball_url | +string | +标签tar包下载地址 |
--返回的JSON示例:
-
{
- "content": "",
- "identifier": "forgeplus",
- attachments: []
-}
-项目模块信息
- ---示例:
-
curl -X GET \
-http://localhost:3000/api/yystopf/ceshi/project_units.json
-await octokit.request('GET /api/yystopf/ceshi/project_units')
-GET /api/yystopf/ceshi/project_units
| 参数 | -类型 | -字段说明 | +tagger | +object | +打标签的人 |
|---|---|---|---|---|---|
| type | +time_ago | string | -模块名称 | +打标签的时间 |
--返回的JSON示例:
-
[
- {
- "type": "code"
- },
- {
- "type": "pulls"
- },
- {
- "type": "issues"
- }
-]
-更改项目模块展示
- ---示例:
-
curl -X POST \
--H "accept: application/json" \
--H "Content-Type: application/json" \
--d "{ \"unit_typs\": [\"code\", \"pulls\"]}" \
-http://localhost:3000/api/yystopf/ceshi/project_units.json
-await octokit.request('POST /api/yystopf/ceshi/project_units')
-POST /api/yystopf/ceshi/project_units
| 参数 | -必选 | -默认 | -类型 | -字段说明 | +created_at_unix | +string | +打标签的时间戳 |
|---|---|---|---|---|---|---|---|
| unit_types | -是 | -- | array | -项目模块内容, 支持以下参数:code:代码库,issues:易修,pulls:合并请求,devops:工作流,versions:里程碑 | +message | +string | +标签信息 |
| 参数 | -类型 | -字段说明 | +commit | +object | +标签最后一个commit |
|---|---|---|---|---|---|
| status | -int | -返回状态, 0: 表示操作成功 | +commit.sha | +string | +commit的id |
| message | +commit.message | string | -返回信息说明 | +commit的提交信息 | +|
| commit.time_ago | +string | +commit的提交时间 | +|||
| commit.created_at_unix | +string | +commit的提交时间戳 | +|||
| commit.committer | +object | +commit的提交者 | +|||
| commit.author | +object | +commit的作者 |
-返回的JSON示例:
{
- "status": 0,
- "message": "success"
-}
-创建项目
+[
+ {
+ "name": "v2.0.0",
+ "id": "c7d0873ee41796d1a0e193063095ccf539a9bf31",
+ "zipball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v2.0.0.zip",
+ "tarball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v2.0.0.tar.gz",
+ "tagger": {
+ "id": 4,
+ "login": "testforge1",
+ "name": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
+ },
+ "time_ago": "1天前",
+ "created_at_unix": 1632376903,
+ "message": "jdfkls",
+ "commit": {
+ "sha": "08fe383f1e5ebe2e2a384a8ea3ee890a758c7cd7",
+ "message": "add\n",
+ "time_ago": "1天前",
+ "created_at_unix": 1632376186,
+ "committer": {
+ "id": 4,
+ "login": "testforge1",
+ "name": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
+ },
+ "author": {
+ "id": 4,
+ "login": "testforge1",
+ "name": "testforge1",
+ "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
+ }
+ }
+ },
+ {
+ "name": "v1.0.0",
+ "id": "12168ad39c3ef201a445a2db181a3e43d50e40dd",
+ "zipball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v1.0.0.zip",
+ "tarball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v1.0.0.tar.gz",
+ "tagger": {
+ "id": null,
+ "login": "viletyy",
+ "name": "viletyy",
+ "image_url": "system/lets/letter_avatars/2/V/39_141_222/120.png"
+ },
+ "time_ago": "10天前",
+ "created_at_unix": 1631588042,
+ "message": "dfks",
+ "commit": {
+ "sha": "5291b5e45a377c1f7710cc6647259887ed7aaccf",
+ "message": "ADD file via upload\n",
+ "time_ago": "21天前",
+ "created_at_unix": 1630648417,
+ "committer": {
+ "id": null,
+ "login": "yystopf",
+ "name": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ },
+ "author": {
+ "id": null,
+ "login": "yystopf",
+ "name": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ }
+ }
+ }
+]
+编辑仓库信息
-示例:
curl -X POST \
--d "user_id=36401" \
--d "name=hnfl_demo" \
--d "description=my first project" \
--d "repository_name=hnfl_demo" \
--d "project_category_id=1" \
--d "project_language_id=2" \
--d "ignore_id=2" \
--d "license_id=1" \
-http://localhost:3000/api/projects.json
-await octokit.request('GET /api/projects.json')
-POST api/projects
curl -X GET http://localhost:3000/api/jasder/jasder_test/edit.json
+await octokit.request('GET /api/jasder/jasder_test/edit.json')
+GET /api/:owner/:repo/edit.json
| 参数 | @@ -4315,86 +6431,67 @@ http://localhost:3000/api/projects.json||||||
|---|---|---|---|---|---|---|
| user_id | -是 | -- | int | -用户id或者组织id | -||
| name | -是 | -- | string | -项目名称 | -||
| description | +owner | 是 | string | -项目描述 | +用户登录名 | |
| repository_name | +repo | 是 | string | -仓库名称, 只含有数字、字母、下划线不能以下划线开头和结尾,且唯一 | +项目标识identifier |
| project_category_id | -是 | -- | int | -项目类别id | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| project_language_id | -是 | -- | int | -项目语言id | +identifier | +string | +仓库标识 |
| ignore_id | -否 | -+ | project_id | int | -gitignore相关id | +项目id | |
| license_id | -否 | -- | int | -开源许可证id | +project_name | +string | +项目名称 |
| private | -否 | -- | boolean | -项目是否私有, true:为私有,false: 公开,默认为公开 | +project_identifier | +string | +项目标识 |
| 参数 | -类型 | -字段说明 | +project_description | +string | +项目简介 |
|---|---|---|---|---|---|
| id | +project_category_id | int | -id | +项目类别id | |
| name | -string | -项目名称 | +project_language_id | +int | +项目语言id | +
| private | +boolean | +项目是否私有, true:为私有,false: 公开 |
返回的JSON示例:
{
- "id": 3240,
- "name": "好项目"
+ "identifier": "project",
+ "project_id": 3263,
+ "project_name": "项目",
+ "project_identifier": "project identifier",
+ "project_description": "project description",
+ "project_category_id": 1,
+ "project_language_id": 2,
+ "private": false
}
-创建镜像项目
+修改仓库信息
-示例:
curl -X POST \
--d "user_id=36408" \
--d "clone_addr=https://gitea.com/mx8090alex/golden.git" \
--d "name=golden_mirror1" \
--d "description=golden_mirror" \
+curl -X PATCH \
+-d "name=hnfl_demo" \
+-d "description=my first project" \
-d "project_category_id=1" \
-d "project_language_id=2" \
-http://localhost:3000/api/projects/migrate.json
-
await octokit.request('GET /api/projects/migrate.json')
-
HTTP 请求
-POST api/projects/migrate.json
-请求参数
+-d "private=true" \
+http://localhost:3000/api/jasder/jasder_test.json
+await octokit.request('PATCH /api/jasder/jasder_test.json')
+PATCH /api/:owner/:repo
| 参数 | @@ -4433,27 +6535,20 @@ http://localhost:3000/api/projects/migrate.json||||||
|---|---|---|---|---|---|---|
| user_id | +id | 是 | int | -用户id或者组织id | +项目id | |
| name | -是 | +否 | string | 项目名称 | ||
| clone_addr | -是 | -- | string | -镜像项目clone地址 | -||
| description | 否 | @@ -4461,56 +6556,35 @@ http://localhost:3000/api/projects/migrate.json | 项目描述 | |||
| repository_name | -是 | -- | string | -仓库名称, 只含有数字、字母、下划线不能以下划线开头和结尾,且唯一 | -||
| project_category_id | -是 | +否 | int | 项目类别id | ||
| project_language_id | -是 | +否 | int | 项目语言id | ||
| is_mirror | -否 | -- | boolean | -是否设置为镜像, true:是, false:否,默认为否 | -||
| auth_username | -否 | -- | string | -镜像源仓库的登录用户名 | -||
| auth_password | +default_branch | 否 | string | -镜像源仓库的登录秘密 | +默认分支名称 | |
| private | 否 | boolean | -项目是否私有, true:为私有,false: 非私有,默认为公开 | +项目是否私有, true:为私有,false: 公开,默认为公开 |
| 参数 | @@ -4524,126 +6598,34 @@ http://localhost:3000/api/projects/migrate.jsonid | |
|---|---|---|
| name | -string | -项目名称 | -
--返回的JSON示例:
-
{
- "id": 3241,
- "name": "这是一个镜像项目"
-}
-手动同步镜像
- ---示例:
-
curl -X POST http://localhost:3000/api/repositories/1244/sync_mirror.json
-await octokit.request('POST /api/repositories/1244/sync_mirror.json')
-POST api/repositories/:id/sync_mirror.json
| 参数 | -必选 | -默认 | -类型 | -字段说明 | -
|---|---|---|---|---|
| id | -是 | -- | int | -仓库id | -
| 参数 | -类型 | -字段说明 | -|
|---|---|---|---|
| status | -int | -状态码, 0:标识请求成功 | -|
| message | +identifier | string | -服务端返回的信息说明 | -
--返回的JSON示例:
-
{
- "status": 0,
- "message": "success"
-}
-fork项目
- ---示例:
-
curl -X POST http://localhost:3000/api/jasder/forgeplus/forks.json
-await octokit.request('POST /api/jaser/jasder_test/forks.json')
-POST api/:owner/:repo/forks.json
| 参数 | -必选 | -默认 | -类型 | -字段说明 | +项目标识 | |
|---|---|---|---|---|---|---|
| owner | -是 | -+ | name | string | -用户登录名 | +项目名称 |
| repo | -是 | -+ | description | string | -项目标识identifier | +项目简介 |
| 参数 | -类型 | -字段说明 | +project_category_id | +int | +项目类别id |
|---|---|---|---|---|---|
| id | +project_language_id | int | -项目id | +项目语言id | |
| identifier | -string | -项目标识 | +private | +否 | +boolean |
返回的JSON示例:
{
- "id": 3290,
- "identifier": "newadm"
+ "id": 3263,
+ "identifier": "project identifier",
+ "name": "project name",
+ "description": "project description",
+ "project_category_id": 1,
+ "project_language_id": 2,
+ "is_public": true
}
-用户管理的组织列表
+删除仓库
-示例:
curl -X GET \
-http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizations.json | jq
-await octokit.request('GET /api/:owner/:repo/applied_transfer_projects/organizations')
-GET api/:owner/:repo/applied_transfer_projects/organizations
curl -X DELETE http://localhost:3000/api/jasder/jasder_test.json
+await octokit.request('DELETE /api/jasder/jasder_test.json')
+PATCH /api/:owner/:repo
| 参数 | @@ -4690,7 +6676,7 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat项目标识identifier |
|---|
| 参数 | @@ -4699,24 +6685,14 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat|||||
|---|---|---|---|---|---|
| name | -string | -组织标识 | -|||
| nickname | -string | -组织名称 | +status | +int | +返回状态, 0: 表示操作成功 |
| description | +message | string | -组织描述 | -||
| avatar_url | -string|组织头像 | -+ | 返回信息说明 |
返回的JSON示例:
{
- "total_count": 3,
- "organizations": [
- {
- "id": 9,
- "name": "ceshi_org",
- "nickname": "测试组织",
- "description": "测试组织",
- "avatar_url": "images/avatars/Organization/9?t=1612706073"
- },
- {
- "id": 51,
- "name": "ceshi",
- "nickname": "测试组织哈哈哈",
- "description": "23212312",
- "avatar_url": "images/avatars/Organization/51?t=1618800723"
- },
- {
- "id": 52,
- "name": "ceshi1",
- "nickname": "身份卡手动阀",
- "description": "1231手动阀是的",
- "avatar_url": "images/avatars/Organization/52?t=1618805056"
- }
- ]
+ "status": 0,
+ "message": "success"
}
-迁移项目,edit接口is_transfering为true表示正在迁移
+ + +仓库中添加成员操作
-示例:
curl -X POST http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects.json
-await octokit.request('POST /api/:owner/:repo/applied_transfer_projects.json')
-POST /api/:owner/:repo/applied_transfer_projects.json
curl -X POST \
+-d "user_id=12" \
+http://localhost:3000/api/jasder/jasder_test/collaborators.json
+await octokit.request('POST /api/jasder/jasder_test/collaborators.json')
+POST /api/:owner/:repo/collaborators.json
| 参数 | @@ -4784,14 +6744,14 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat项目标识identifier | ||||||
|---|---|---|---|---|---|---|---|
| owner_name | +user_id | 是 | +int | - | string | -迁移对象标识 | +用户id |
| 参数 | @@ -4800,119 +6760,89 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat||||
|---|---|---|---|---|
| id | -int | -项目id | -||
| status | -string | -项目迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | -||
| time_ago | -string | -项目迁移创建的时间 | -||
| project.id | int | -迁移项目的id | -||
| project.identifier | -string | -迁移项目的标识 | -||
| project.name | -string | -迁移项目的名称 | -||
| project.description | -string | -迁移项目的描述 | -||
| project.is_public | -bool | -迁移项目是否公开 | -||
| project.owner.id | -bool | -迁移项目拥有者id | +返回状态, 0: 表示操作成功 | |
| project.owner.type | +message | string | -迁移项目拥有者类型 | +返回信息说明 |
++返回的JSON示例:
+
{
+ "status": 0,
+ "message": "success"
+}
+仓库中删除成员操作
+ +++示例:
+
curl -X DELETE \
+-d "user_id=12" \
+http://localhost:3000/api/jasder/jasder_test/collaborators.json
+await octokit.request('DELETE /api/jasder/jasder_test/collaborators.json')
+DELETE /api/:owner/:repo/collaborators.json
| project.owner.name | -string | -迁移项目拥有者昵称 | +参数 | +必选 | +默认 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| project.owner.login | +owner | +是 | +string | -迁移项目拥有者标识 | +用户登录名 | ||
| project.owner.image_url | +repo | +是 | +string | -迁移项目拥有者头像 | +项目标识identifier | ||
| user.id | +user_id | +是 | int | -迁移创建者的id | -|||
| user.type | -string | -迁移创建者的类型 | -|||||
| user.name | -string | -迁移创建者的名称 | -|||||
| user.login | -string | -迁移创建者的标识 | ++ | 用户id |
| user.image_url | -string | -迁移创建者头像 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| owner.id | +status | int | -迁移接受者的id | -||
| owner.type | -string | -迁移接受者的类型 | -|||
| owner.name | -string | -迁移接受者的名称 | -|||
| owner.login | -string | -迁移接受者的标识 | +返回状态, 0: 表示操作成功 | ||
| owner.image_url | +message | string | -迁移接受者头像 | +返回信息说明 |
返回的JSON示例:
{
- "project": {
- "id": 86,
- "identifier": "ceshi_repo1",
- "name": "测试项目啊1",
- "description": "二十多",
- "is_public": true,
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "yystopf",
- "login": "yystopf",
- "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
- },
- "owner": {
- "id": 9,
- "type": "Organization",
- "name": "测试组织",
- "login": "ceshi_org",
- "image_url": "images/avatars/Organization/9?t=1612706073"
- },
- "id": 4,
- "status": "common",
- "created_at": "2021-04-26 09:54",
- "time_ago": "1分钟前"
+ "status": 0,
+ "message": "success"
}
-迁移项目,edit接口is_transfering为true表示正在迁移
+ + +更改仓库成员角色
-示例:
curl -X POST http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/cancel.json
-await octokit.request('POST /api/:owner/:repo/applied_transfer_projects/cancel.json')
-POST /api/:owner/:repo/applied_transfer_projects/cancel.json
curl -X PUT \
+-d "user_id=12" \
+-d "role=Developer" \
+http://localhost:3000/api/jasder/jasder_test/change_role.json
+await octokit.request('PUT /api/jasder/jasder_test/change_role.json')
+PUT /api/:owner/:repo/change_role.json
| 参数 | @@ -4987,8 +6894,22 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizatstring | 项目标识identifier | ||
|---|---|---|---|---|
| user_id | +是 | +int | ++ | 用户id | +
| role | +是 | +string | ++ | 取值范围:"Manager", "Developer", "Reporter";分别为项目管理人员(拥有所有操作权限)、项目开发人员(只拥有读写权限)、项目报告人员(只拥有读权限) | +
| 参数 | @@ -4997,119 +6918,127 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat||||
|---|---|---|---|---|
| id | -int | -迁移id | -||
| status | -string | -迁移状态,canceled:取消,common:正在迁移, accept:已接受,refuse:已拒绝 | -||
| time_ago | -string | -迁移创建的时间 | -||
| project.id | int | -迁移项目的id | +返回状态, 0: 表示操作成功 | |
| project.identifier | +message | string | -迁移项目的标识 | +返回信息说明 |
++返回的JSON示例:
+
{
+ "status": 0,
+ "message": "success"
+}
+获取仓库成员列表
+ +++示例:
+
curl -X GET \
+-d "page=1" \
+-d "limit=5" \
+http://localhost:3000/api/jasder/jasder_test/collaborators.json
+await octokit.request('GET /api/jasder/jasder_test/collaborators.json')
+GET /api/:owner/:repo/collaborators.json
| project.name | -string | -迁移项目的名称 | +参数 | +必选 | +默认 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| project.description | +owner | +是 | +string | -迁移项目的描述 | -|||
| project.is_public | -bool | -迁移项目是否公开 | -|||||
| project.owner.id | -bool | -迁移项目拥有者id | +用户登录名 | ||||
| project.owner.type | +repo | +是 | +string | -迁移项目拥有者类型 | +项目标识identifier | ||
| project.owner.name | +page | +否 | +string | -迁移项目拥有者昵称 | +页数,第几页 | ||
| project.owner.login | +limit | +否 | +string | -迁移项目拥有者标识 | +每页多少条数据,默认15条 |
| project.owner.image_url | -string | -迁移项目拥有者头像 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| user.id | +total_count | int | -迁移创建者的id | -||
| user.type | -string | -迁移创建者的类型 | +返回记录总条数 | ||
| user.name | -string | -迁移创建者的名称 | +members | +array | +项目成员信息 |
| user.login | -string | -迁移创建者的标识 | +-- id | +int | +用户id |
| user.image_url | +-- name | string | -迁移创建者头像 | -||
| owner.id | -int | -迁移接受者的id | +用户名称 | ||
| owner.type | +-- login | string | -迁移接受者的类型 | +用户登录名/标识 | |
| owner.name | +-- image_url | string | -迁移接受者的名称 | +用户头像 | |
| owner.login | -string | -迁移接受者的标识 | +-- is_owner | +boolean | +是否是项目的拥有者,true:是, false:不是 |
| owner.image_url | +-- role | string | -迁移接受者头像 | +该用户在项目中的角色, Manager: 管理员(拥有操作权限); Developer:开发人员(只拥有读写权限); Reporter:报告人员(只拥有读权限) |
返回的JSON示例:
{
- "project": {
- "id": 86,
- "identifier": "ceshi_repo1",
- "name": "测试项目啊1",
- "description": "二十多",
- "is_public": true,
- "owner": {
- "id": 52,
- "type": "Organization",
- "name": "身份卡手动阀",
- "login": "ceshi1",
- "image_url": "images/avatars/Organization/52?t=1618805056"
- }
- },
- "user": {
- "id": 6,
- "type": "User",
- "name": "yystopf",
- "login": "yystopf",
- "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
- },
- "owner": {
- "id": 9,
- "type": "Organization",
- "name": "测试组织",
- "login": "ceshi_org",
- "image_url": "images/avatars/Organization/9?t=1612706073"
+ "total_count": 2,
+ "members": [
+ {
+ "id": 36401,
+ "name": "name",
+ "login": "login",
+ "image_url": "avatars/User/b",
+ "is_owner": true,
+ "role": "Manager"
},
- "id": 4,
- "status": "common",
- "created_at": "2021-04-26 09:54",
- "time_ago": "1分钟前"
+ {
+ "id": 36399,
+ "name": "name",
+ "login": "login",
+ "image_url": "avatars/User/b",
+ "is_owner": false,
+ "role": "Developer"
+ }
+ ]
}
-仓库详情
+ + +获取仓库所有文件
-示例:
curl -X GET http://localhost:3000/api/jasder/jasder_test.json
-await octokit.request('GET /api/jasder/jasder_test.json')
-GET /api/:owner/:repo
curl -X GET \
+-d "ref=develop" \
+http://localhost:3000/api/yystopf/ceshi/files.json
+await octokit.request('GET /api/yystopf/ceshi/files.json')
+GET /api/:owner/:repo/files
| 参数 | @@ -5184,8 +7106,22 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizatstring | 项目标识identifier | ||
|---|---|---|---|---|
| search | +否 | ++ | string | +文件搜索关键词 | +
| ref | +是 | ++ | string | +分支名,默认为仓库默认分支 | +
| 参数 | @@ -5194,64 +7130,82 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat|||||
|---|---|---|---|---|---|
| id | -int | -id | -|||
| name | string | -项目名称 | +文件名称 | ||
| identifier | +path | string | -项目标识 | +文件路径 | |
| is_public | -boolean | -项目是否公开, true:公开,false:私有 | +sha | +string | +文件标识 |
| description | +type | string | -项目简介 | +文件类型 | |
| repo_id | +size | int | -仓库id | +文件大小 | |
| repo_identifier | +url | string | -仓库标识 | +文件地址 |
-返回的JSON示例:
{
- "name": "ni项目",
- "identifier": "mirror_demo",
- "is_public": true,
- "description": "my first project mirror_demo",
- "repo_id": 75073,
- "repo_identifier": "mirror_demo"
-}
-仓库详情
+[
+ {
+ "name": ".gitignore",
+ "path": ".gitignore",
+ "sha": "f83922d01ae60f6e637a1a2b9f08871b4f87dfc8",
+ "type": "file",
+ "size": 63,
+ "url": "http://localhost:10080/api/v1/repos/yystopf/ceshi/contents/.gitignore?ref=master",
+ "html_url": "http://localhost:10080/yystopf/ceshi/src/branch/master/.gitignore"
+ },
+ {
+ "name": "LICENSE",
+ "path": "LICENSE",
+ "sha": "8f3b9ab0d08afd3a624d822e3971a2f42b3bc2b9",
+ "type": "file",
+ "size": 341,
+ "url": "http://localhost:10080/api/v1/repos/yystopf/ceshi/contents/LICENSE?ref=master",
+ "html_url": "http://localhost:10080/yystopf/ceshi/src/branch/master/LICENSE"
+ },
+ {
+ "name": "README.md",
+ "path": "README.md",
+ "sha": "1bc8a60ac6ddc876ebc4b60fc68991435bfad93e",
+ "type": "file",
+ "size": 9,
+ "url": "http://localhost:10080/api/v1/repos/yystopf/ceshi/contents/README.md?ref=master",
+ "html_url": "http://localhost:10080/yystopf/ceshi/src/branch/master/README.md"
+ }
+]
+获取仓库代码目录
-示例:
curl -X GET http://localhost:3000/api/jasder/jasder_test/simple.json
-await octokit.request('GET /api/jasder/jasder_test/simple.json')
-GET /api/:owner/:repo/simple
curl -X GET \
+-d "ref=develop" \
+http://localhost:3000//api/jasder/jasder_test/entries.json
+await octokit.request('GET /api/jasder/jasder_test/entries.json')
+GET /api/:owner/:repo/entries.json
| 参数 | @@ -5275,8 +7229,15 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizatstring | 项目标识identifier | ||
|---|---|---|---|---|
| ref | +否 | ++ | string | +分支名称、tag名称或是提交记录id,默认为master分支 | +
| 参数 | @@ -5285,6 +7246,16 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat||||
|---|---|---|---|---|
| last_commit | +object | ++ | ||
| -- commit | +object | ++ | ||
| id | int | id | @@ -5292,32 +7263,32 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat||
| name | string | -项目名称 | +文件夹或文件名称 | |
| identifier | +path | string | -项目标识 | -|
| is_public | -boolean | -项目是否公开, true:公开,false:私有 | +文件夹或文件相对路径 | |
| description | +type | string | -项目简介 | +文件类型, file:文件,dir:文件目录 |
| repo_id | +size | int | -仓库id | +文件夹或文件大小 单位B |
| repo_identifier | +content | string | -仓库标识 | +文件内容 | +
| target | +string | +标签 |
返回的JSON示例:
{
- "name": "ni项目",
- "identifier": "mirror_demo",
- "is_public": true,
- "description": "my first project mirror_demo",
- "repo_id": 75073,
- "repo_identifier": "mirror_demo"
+ "last_commit": {
+ "commit": {
+ "sha": "3f2de4f78d2d7050486535082cd11cdfc9f3679e",
+ "url": "http://localhost:3003//api/repositories/api-cloud-platform/commits/3f2de4f78d2d7050486535082cd11cdfc9f3679e",
+ "message": "update README.md.",
+ "author": {
+ "name": "Gitee",
+ "email": "noreply@gitee.com",
+ "date": "2020-03-02T20:23:18+08:00"
+ },
+ "committer": {
+ "name": "Gitee",
+ "email": "noreply@gitee.com",
+ "date": "2020-03-02T20:23:18+08:00"
+ },
+ "timestamp": 1583151798,
+ "time_from_now": "3个月前"
+ },
+ "author": null,
+ "committer": null
+ },
+ "entries": [
+ {
+ "name": "ace-gate",
+ "path": "ace-gate",
+ "sha": "c83f85fc63b14edcd6fc502eee9996f5a9993eca",
+ "type": "dir",
+ "size": 0,
+ "content": null,
+ "target": null,
+ "commit": {
+ "message": "v2.9 升级alibaba组件release版本\n",
+ "sha": "6117eaab86f71115f42f2a46ff1683015cda798d",
+ "created_at": "1970-01-01 08:00",
+ "time_from_now": "1年前",
+ "created_at_unix": null
+ }
+ }
+ ]
}
-仓库详情
+ + +获取仓库代码子目录或者文件
-示例:
curl -X GET http://localhost:3000/api/yystopf/ceshi/detail.json
-await octokit.request('GET /api/yystopf/ceshi/detail.json')
-GET /api/:owner/:repo/detail
curl -X GET \
+-d "ref=master" \
+-d "filepath=file" \
+http://localhost:3000//api/jasder/jasder_test/sub_entries.json
+await octokit.request('GET /api/jasder/jasder_test/sub_entries.json')
+GET /api/:owner/:repo/sub_entries.json
| 参数 | @@ -5354,251 +7365,321 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat||||
|---|---|---|---|---|
| owner | -是 | -- | string | -用户登录名 | -
| repo | -是 | -- | string | -项目标识identifier | -
| 参数 | -类型 | -字段说明 | -|||||
|---|---|---|---|---|---|---|---|
| content | -string | -仓库简介 | -|||||
| website | -string | -仓库网址 | -|||||
| readme | -string | -readme文件| | -|||||
| identifier | -string | -项目标识 | -|||||
| name | +是 | +string | -项目名称 | +用户登录名 | |||
| issues_count | -int | -项目issue数量 | +repo | +是 | ++ | string | +项目标识identifier |
| pull_requests_count | -int | -项目合并请求数量 | +filepath | +是 | +string | +文件夹、文件的相对路径 | +|
| project_identifier | -int | -项目标识 | +ref | +否 | ++ | string | +分支名称、tag名称或是提交记录id,默认为master分支 |
| praises_count | -int | -项目点赞数量 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| forked_count | +id | int | -项目复刻数量 | +id | |
| watchers_count | -int | -项目关注数量 | +name | +string | +文件夹或文件名称 |
| versions_count | -int | -项目里程碑数量 | +path | +string | +文件夹或文件相对路径 |
| version_releases_count | -int | -项目发行版数量 | +type | +string | +文件类型, file:文件,dir:文件目录 |
| version_releasesed_count | +size | int | -项目发行版已发行数量 | +文件夹或文件大小 单位KB | |
| permission | +content | string | -项目权限 | +文件内容, | |
| mirror_url | +target | string | -镜像地址 | +标签 | |
| mirror | -bool | -是否为镜像项目 | +url | +string | +文件访问链接,带分支 |
| type | -int | -项目类型 0 普通项目 1 普通镜像项目 2 同步镜像项目 | +html_url | +string | +文件访问链接,未标识分支 |
| open_devops | -int | -是否开启devops | +git_url | +string | +文件夹或文件的git仓库访问链接 |
| watched | -bool | -是否关注 | +download_url | +string | +文件下载、文件内容访问链接 |
++返回的JSON示例:
+
[
+ {
+ "name": "build.rc",
+ "path": "lib/build.rc",
+ "type": "",
+ "size": 1268,
+ "content": null,
+ "target": null,
+ "url": "http://localhost:3003/api/v1/repos/18816895620/mirror_demo/contents/lib/build.rc?ref=master",
+ "html_url": "http://localhost:3003/18816895620/mirror_demo/src/branch/master/lib/build.rc",
+ "git_url": "http://localhost:3003/api/v1/repos/18816895620/mirror_demo/git/blobs/191fcf1a63b3777e2977fcede7dd5309efdd70fe",
+ "download_url": null
+ }
+]
+获取仓库README文件
+ +++示例:
+
curl -X GET \
+-d "ref=master" \
+-d "filepath=lib" \
+http://localhost:3000/api/yystopf/csfjkkj/readme.json
+await octokit.request('GET /api/yystopf/csfjkkj/readme.json')
+GET /api/:owner/:repo/readme.json
| praised | -bool | -是否点赞 | +参数 | +必选 | +默认 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| status | -int | -项目状态 | +owner | +是 | ++ | string | +用户登录名 |
| forked_from_project_id | -int | -fork项目id | +repo | +是 | ++ | string | +项目标识identifier |
| fork_info | -object | -fork项目信息 | +ref | +否 | ++ | string | +分支名称、tag名称或是提交记录id,默认为默认分支 |
| size | +filepath | +否 | +string | -仓库大小 | +子目录名称,默认为空 |
| ssh_url | -string | -项目ssh地址 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| clone_url | +type | string | -项目克隆地址 | +文件类型, file:文件,dir:文件目录 | |
| default_branch | +encoding | string | -仓库默认分支 | +编码 | |
| empty | -bool | -仓库是否为空 | +size | +int | +文件夹或文件大小 单位B |
| full_name | +name | string | -仓库全称 | +文件夹或文件名称 | |
| private | -bool | -仓库是否为私有项目 | +path | +string | +文件夹或文件相对路径 |
| license_name | +content | string | -许可证名称 | +文件内容 | |
| release_versions.list.name | +sha | string | -项目issue数量 | +文件commitid |
++返回的JSON示例:
+
{
+ "type": "file",
+ "encoding": "base64",
+ "size": 24,
+ "name": "README.md",
+ "path": "lib/README.md",
+ "content": "ZGZhc2RhZGpmIGRrZnNsCgpzZGZkZnMK",
+ "sha": "860962cd21c60b1a9e07d723080c87c32c18d44a"
+}
+获取仓库贡献者
+ +++示例:
+
curl -X GET \
+-d "ref=master" \
+-d "filepath=lib" \
+http://localhost:3000/api/yystopf/csfjkkj/contributors.json
+await octokit.request('GET /api/yystopf/csfjkkj/contributors.json')
+GET /api/:owner/:repo/contributors.json
| release_versions.list.tag_name | -string | -发行版标签名称 | +参数 | +必选 | +默认 | +类型 | +字段说明 |
|---|---|---|---|---|---|---|---|
| release_versions.list.created_at | +owner | +是 | +string | -发行版创建时间 | +用户登录名 | ||
| release_versions.total_count | -int | -发行版数量 | +repo | +是 | ++ | string | +项目标识identifier |
| branches.list.name | +ref | +否 | +string | -分支名称 | +分支名称、tag名称或是提交记录id,默认为整个仓库 | ||
| branches.total_count | -int | -分支数量 | +filepath | +否 | ++ | string | +子目录名称,默认为空 |
| tags.list.name | -string | -标签名称 | +参数 | +类型 | +字段说明 |
|---|---|---|---|---|---|
| tags.total_count | -int | -标签数量 | +total_count | +integer | +贡献者数量 |
| contributors.list.contributions | -int | +contributions | +integer | 贡献数量 | |
| contributors.list.login | +login | string | -贡献者登录名 | +用户登录名 | |
| contributors.list.name | +type | string | -贡献者用户名称 | +用户类型 | |
| contributors.list.image_url | +name | string | -贡献者头像 | +用户昵称 | |
| languages | -object | -项目语言占比 | +image_url | +string | +用户头像 |
返回的JSON示例:
{
- "content": "仓库简介",
- "website": "仓库网址",
- "readme": {
- "type": "file",
- "encoding": "base64",
- "size": 9,
- "name": "README.md",
- "path": "README.md",
- "content": "# ceshi\n\n",
- "sha": ""
- },
- "identifier": "ceshi",
- "name": "测试项目",
- "project_id": 2,
- "repo_id": 2,
- "issues_count": 0,
- "pull_requests_count": 0,
- "project_identifier": "ceshi",
- "praises_count": 0,
- "forked_count": 0,
- "watchers_count": 0,
- "versions_count": 0,
- "version_releases_count": 0,
- "version_releasesed_count": 0,
- "permission": "Reporter",
- "mirror_url": null,
- "mirror": false,
- "type": 0,
- "open_devops": false,
- "watched": false,
- "praised": false,
- "status": 1,
- "forked_from_project_id": 1,
- "fork_info": {
- "fork_form_name": "测试项目",
- "fork_project_user_login": "ceshi_org",
- "fork_project_identifier": "ceshi",
- "fork_project_user_name": "ceshi_org"
- },
- "size": "25.0 KB",
- "ssh_url": "virus@localhost:yystopf/ceshi.git",
- "clone_url": "http://localhost:10080/yystopf/ceshi.git",
- "default_branch": "master",
- "empty": false,
- "full_name": "yystopf/ceshi",
- "private": false,
- "license_name": "gnu-javamail-exception",
- "release_versions": {
- "list": [
- {
- "id": 2,
- "name": "vvvv",
- "tag_name": "v1.1",
- "created_at": "2019-07-18 10:16"
- }
- ],
- "total_count": 1
- },
- "branches": {
- "list": [
- {
- "name": "master"
- }
- ],
- "total_count": 1
- },
- "tags": {
- "list": [
- {
- "name": "v1.1"
- },
- {
- "name": "v1.0"
- }
- ],
- "total_count": 2
- },
- "contributors": {
- "list": [
- {
- "contributions": 1,
- "gid": 2,
- "login": "yystopf",
- "type": "User",
- "name": "yystopf",
- "image_url": "avatars/User/b"
- }
- ],
- "total_count": 1
- },
- "languages": {
- "HTML": "50.9%",
- "Ruby": "25.6%",
- "JavaScript": "21.4%",
- "CSS": "1.3%",
- "CoffeeScript": "0.7%",
- "Shell": "0.1%"
- }
+ "contributors": [
+ {
+ "contributions": 5,
+ "login": "testforge2",
+ "type": "User",
+ "name": "testforge2",
+ "image_url": "system/lets/letter_avatars/2/T/236_177_85/120.png"
+ },
+ {
+ "contributions": 79,
+ "login": "yystopf",
+ "type": "User",
+ "name": "yystopf",
+ "image_url": "system/lets/letter_avatars/2/Y/241_125_89/120.png"
+ }
+ ],
+ "total_count": 2
}
-编辑仓库信息
+ + +获取仓库webhooks列表
-示例:
curl -X GET http://localhost:3000/api/jasder/jasder_test/edit.json
-await octokit.request('GET /api/jasder/jasder_test/edit.json')
-GET /api/:owner/:repo/edit.json
curl -X GET \
+http://localhost:3000/api/yystopf/ceshi/webhooks.json
+await octokit.request('GET /api/yystopf/ceshi/webhooks.json')
+GET /api/:owner/:repo/webhooks.json
| 参数 | @@ -5740,7 +7745,7 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat项目标识identifier |
|---|
| 参数 | @@ -5749,44 +7754,39 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat|||||
|---|---|---|---|---|---|
| identifier | -string | -仓库标识 | -|||
| project_id | +id | int | -项目id | +id | |
| project_name | +url | string | -项目名称 | +地址 | |
| project_identifier | +http_method | string | -项目标识 | +请求方式 | |
| project_description | -string | -项目简介 | +is_active | +bool | +是否激活 |
| project_category_id | -int | -项目类别id | +type | +string | +类型 |
| project_language_id | -int | -项目语言id | +last_status | +string | +最后一次推送的状态 |
| private | -boolean | -项目是否私有, true:为私有,false: 公开 | +create_time | +string | +创建时间 |
返回的JSON示例:
{
- "identifier": "project",
- "project_id": 3263,
- "project_name": "项目",
- "project_identifier": "project identifier",
- "project_description": "project description",
- "project_category_id": 1,
- "project_language_id": 2,
- "private": false
+ "total_count": 4,
+ "webhooks": [
+ {
+ "id": 2,
+ "url": "https://oapi.dingtalk.com/robot/send?access_token=7e1e19d0eddb6a5e33c5c2c4e66f4c88f9437184b9ed2c2653194c6374c7d513",
+ "http_method": "",
+ "is_active": true,
+ "type": "dingtalk",
+ "last_status": "succeed",
+ "create_time": "2021-07-12 10:50:07"
+ },
+ {
+ "id": 3,
+ "url": "http://localhost:3000",
+ "http_method": "GET",
+ "is_active": true,
+ "type": "gitea",
+ "last_status": "succeed",
+ "create_time": "2021-07-26 10:03:45"
+ },
+ {
+ "id": 4,
+ "url": "http://localhost:10081",
+ "http_method": "POST",
+ "is_active": true,
+ "type": "gitea",
+ "last_status": "waiting",
+ "create_time": "2021-07-26 16:56:53"
+ },
+ {
+ "id": 5,
+ "url": "http://localhost:3001",
+ "http_method": "POST",
+ "is_active": true,
+ "type": "gitea",
+ "last_status": "fail",
+ "create_time": "2021-07-26 16:58:23"
+ }
+ ]
}
-修改仓库信息
+ + +获取仓库单个webhook
-示例:
curl -X PATCH \
--d "name=hnfl_demo" \
--d "description=my first project" \
--d "project_category_id=1" \
--d "project_language_id=2" \
--d "private=true" \
-http://localhost:3000/api/jasder/jasder_test.json
-await octokit.request('PATCH /api/jasder/jasder_test.json')
-PATCH /api/:owner/:repo
curl -X GET \
+http://localhost:3000/api/yystopf/ceshi/webhooks/3/edit.json
+await octokit.request('GET /api/yystopf/ceshi/webhooks/3/edit.json')
+GET /api/:owner/:repo/webhooks/:id/edit.json
| 参数 | @@ -5830,56 +7860,28 @@ http://localhost:3000/api/jasder/jasder_test.json||||||||
|---|---|---|---|---|---|---|---|---|
| id | +owner | 是 | - | int | -项目id | -|||
| name | -否 | -- | string | -项目名称 | -||||
| description | -否 | -string | -项目描述 | -|||||
| project_category_id | -否 | -- | int | -项目类别id | -||||
| project_language_id | -否 | -- | int | -项目语言id | +用户登录名 | |||
| default_branch | -否 | +repo | +是 | string | -默认分支名称 | +项目标识identifier | ||
| private | -否 | +id | +是 | - | boolean | -项目是否私有, true:为私有,false: 公开,默认为公开 | +integer | +webhook ID |
| 参数 | @@ -5893,101 +7895,142 @@ http://localhost:3000/api/jasder/jasder_test.jsonid | ||||
|---|---|---|---|---|---|
| identifier | +url | string | -项目标识 | +地址 | |
| name | +content_type | string | -项目名称 | +POST Content Type | |
| description | +http_method | string | -项目简介 | +请求方式 | |
| project_category_id | -int | -项目类别id | +secret | ++ | string |
| project_language_id | -int | -项目语言id | +is_active | +bool | +是否激活 |
| private | -否 | -boolean | +type | +string | +类型 |
--返回的JSON示例:
-
{
- "id": 3263,
- "identifier": "project identifier",
- "name": "project name",
- "description": "project description",
- "project_category_id": 1,
- "project_language_id": 2,
- "is_public": true
-}
-删除仓库
- ---示例:
-
curl -X DELETE http://localhost:3000/api/jasder/jasder_test.json
-await octokit.request('DELETE /api/jasder/jasder_test.json')
-PATCH /api/:owner/:repo
| 参数 | -必选 | -默认 | -类型 | -字段说明 | +last_status | +string | +最后一次推送的状态, waiting 等待,fail 失败,succeed 成功 |
|---|---|---|---|---|---|---|---|
| owner | -是 | -+ | branch_filter | string | -用户登录名 | +分支过滤 | |
| repo | -是 | -+ | events | string | -项目标识identifier | +触发条件 | +|
| create_time | +string | +创建时间 |
| 参数 | -类型 | -字段说明 | +含义 | |
|---|---|---|---|---|
| status | -int | -返回状态, 0: 表示操作成功 | +create | +创建分支或标签 |
| message | -string | -返回信息说明 | +delete | +分支或标签删除 | +
| fork | +仓库被fork | +|||
| push | +git仓库推送 | +|||
| issue | +易修已打开、已关闭、已重新打开或编辑 | +|||
| issue_assign | +易修被指派 | +|||
| issue_label | +易修标签被更新或删除 | +|||
| issue_milestone | +易修被收入里程碑 | +|||
| issue_comment | +易修评论 | +|||
| pull_request | +合并请求 | +|||
| pull_request_assign | +合并请求被指派 | +|||
| pull_request_label | +合并请求被贴上标签 | +|||
| pull_request_milestone | +合并请求被记录于里程碑中 | +|||
| pull_request_comment | +合并请求被评论 | +|||
| pull_request_review_approved | +合并请求被批准 | +|||
| pull_request_review_rejected | +合并请求被拒绝 | +|||
| pull_request_review_comment | +合并请求被提出审查意见 | +|||
| pull_request_sync | +合并请求被同步 | +|||
| repository | +创建或删除仓库 | +|||
| release | +版本发布 |
返回的JSON示例:
{
- "status": 0,
- "message": "success"
+ "id": 3,
+ "http_method": "GET",
+ "content_type": "form",
+ "url": "http://localhost:3000",
+ "secret": "123456",
+ "last_status": "succeed",
+ "is_active": true,
+ "type": "gitea",
+ "create_time": "2021-07-26 10:03:45",
+ "branch_filter": "*",
+ "events": [
+ "create",
+ "delete",
+ "fork",
+ "issues",
+ "issue_assign",
+ "issue_label",
+ "issue_milestone",
+ "issue_comment",
+ "push",
+ "pull_request",
+ "pull_request_assign",
+ "pull_request_label",
+ "pull_request_milestone",
+ "pull_request_comment",
+ "pull_request_review",
+ "pull_request_sync",
+ "repository",
+ "release"
+ ]
}