Merge branch 'develop' into dev_trustie_server
This commit is contained in:
commit
bf390c8366
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -1,6 +1,21 @@
|
|||
# Changelog
|
||||
## [v3.1.0](https://forgeplus.trustie.net/projects/jasder/forgeplus/releases) - 2021-06-09
|
||||
|
||||
* ENHANCEMENTS
|
||||
* ADD 用户活动统计图表功能
|
||||
* ADD 用户精选项目功能
|
||||
* ADD 用户贡献度统计图表功能
|
||||
* ADD 用户开发能力数据统计工
|
||||
* ADD 用户角色定位展示功能
|
||||
* ADD 用户专业定位标签展示功能
|
||||
* ADD 修改用户基本资料功能
|
||||
* ADD 更改密码功能
|
||||
* ADD 用户个人主页基本现在展示可配置功能
|
||||
|
||||
* BUGFIXES
|
||||
* Fix 解决一些bug
|
||||
* Fix 优化美化页面
|
||||
|
||||
## [v3.0.4](https://forgeplus.trustie.net/projects/jasder/forgeplus/releases) - 2021-05-24
|
||||
|
||||
* BUGFIXES
|
||||
* Fix 在线修改文件,页面文件显不及时的问题(46049)
|
||||
|
|
137
LICENSE
137
LICENSE
|
@ -1,21 +1,124 @@
|
|||
MIT License
|
||||
木兰宽松许可证, 第2版
|
||||
|
||||
Copyright (c) [year] [fullname]
|
||||
2020年1月 http://license.coscl.org.cn/MulanPSL2
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
0. 定义
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
|
||||
|
||||
“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
|
||||
|
||||
“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
|
||||
|
||||
“法人实体” 是指提交贡献的机构及其“关联实体”。
|
||||
|
||||
“关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
|
||||
|
||||
1. 授予版权许可
|
||||
|
||||
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
|
||||
|
||||
2. 授予专利许可
|
||||
|
||||
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
|
||||
|
||||
3. 无商标许可
|
||||
|
||||
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
|
||||
|
||||
4. 分发限制
|
||||
|
||||
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
|
||||
|
||||
5. 免责声明与责任限制
|
||||
|
||||
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
|
||||
|
||||
6. 语言
|
||||
|
||||
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
|
||||
|
||||
条款结束
|
||||
|
||||
如何将木兰宽松许可证,第2版,应用到您的软件
|
||||
|
||||
如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
|
||||
|
||||
1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
|
||||
|
||||
2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
|
||||
|
||||
3, 请将如下声明文本放入每个源文件的头部注释中。
|
||||
|
||||
Copyright (c) [Year] [name of copyright holder]
|
||||
[Software Name] is licensed under Mulan PSL v2.
|
||||
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
You may obtain a copy of Mulan PSL v2 at:
|
||||
http://license.coscl.org.cn/MulanPSL2
|
||||
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
See the Mulan PSL v2 for more details.
|
||||
Mulan Permissive Software License,Version 2
|
||||
Mulan Permissive Software License,Version 2 (Mulan PSL v2)
|
||||
|
||||
January 2020 http://license.coscl.org.cn/MulanPSL2
|
||||
|
||||
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
|
||||
|
||||
0. Definition
|
||||
|
||||
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
|
||||
|
||||
Contribution means the copyrightable work licensed by a particular Contributor under this License.
|
||||
|
||||
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
|
||||
|
||||
Legal Entity means the entity making a Contribution and all its Affiliates.
|
||||
|
||||
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
|
||||
|
||||
1. Grant of Copyright License
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
|
||||
|
||||
2. Grant of Patent License
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
|
||||
|
||||
3. No Trademark License
|
||||
|
||||
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in section 4.
|
||||
|
||||
4. Distribution Restriction
|
||||
|
||||
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
|
||||
|
||||
5. Disclaimer of Warranty and Limitation of Liability
|
||||
|
||||
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
6. Language
|
||||
|
||||
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
|
||||
|
||||
END OF THE TERMS AND CONDITIONS
|
||||
|
||||
How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
|
||||
|
||||
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
|
||||
|
||||
Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
|
||||
Create a file named "LICENSE" which contains the whole context of this License in the first directory of your software package;
|
||||
Attach the statement to the appropriate annotated syntax at the beginning of each source file.
|
||||
Copyright (c) [Year] [name of copyright holder]
|
||||
[Software Name] is licensed under Mulan PSL v2.
|
||||
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
You may obtain a copy of Mulan PSL v2 at:
|
||||
http://license.coscl.org.cn/MulanPSL2
|
||||
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
See the Mulan PSL v2 for more details.
|
|
@ -0,0 +1,13 @@
|
|||
class AppliedProjectsController < ApplicationController
|
||||
before_action :require_login
|
||||
def create
|
||||
@applied_project = Projects::ApplyJoinService.call(current_user, applied_params)
|
||||
rescue Projects::ApplyJoinService::Error => ex
|
||||
render_error(ex.message)
|
||||
end
|
||||
|
||||
private
|
||||
def applied_params
|
||||
params.require(:applied_project).permit(:code, :role)
|
||||
end
|
||||
end
|
|
@ -9,7 +9,7 @@ class Users::AppliedMessagesController < Users::BaseController
|
|||
|
||||
private
|
||||
def check_auth
|
||||
return render_forbidden unless observed_logged_user?
|
||||
return render_forbidden unless current_user.admin? || observed_logged_user?
|
||||
end
|
||||
|
||||
def view_messages
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
class Users::AppliedProjectsController < Users::BaseController
|
||||
before_action :check_auth
|
||||
before_action :find_applied_project, except: [:index]
|
||||
before_action :find_project, except: [:index]
|
||||
|
||||
def index
|
||||
@applied_projects = AppliedProject.where(project_id: observed_user.full_admin_projects)
|
||||
@applied_projects = paginate @applied_projects.order("created_at desc")
|
||||
end
|
||||
|
||||
# 接受申请
|
||||
def accept
|
||||
@applied_project = Projects::AcceptJoinService.call(current_user, @applied_project)
|
||||
rescue Exception => e
|
||||
uid_logger_error(e.message)
|
||||
tip_exception(e.message)
|
||||
end
|
||||
|
||||
# 拒绝申请
|
||||
def refuse
|
||||
@applied_project = Projects::RefuseJoinService.call(current_user, @applied_project)
|
||||
rescue Exception => e
|
||||
uid_logger_error(e.message)
|
||||
tip_exception(e.message)
|
||||
end
|
||||
|
||||
private
|
||||
def check_auth
|
||||
return render_forbidden unless current_user.admin? || observed_logged_user?
|
||||
end
|
||||
|
||||
def find_applied_project
|
||||
@applied_project = AppliedProject.find_by_id params[:id]
|
||||
end
|
||||
|
||||
def find_project
|
||||
@project = @applied_project.project
|
||||
end
|
||||
end
|
|
@ -28,7 +28,7 @@ class Users::AppliedTransferProjectsController < Users::BaseController
|
|||
|
||||
private
|
||||
def check_auth
|
||||
return render_forbidden unless observed_logged_user?
|
||||
return render_forbidden unless current_user.admin? || observed_logged_user?
|
||||
end
|
||||
|
||||
def find_applied_transfer_project
|
||||
|
|
|
@ -28,13 +28,15 @@ class UsersController < ApplicationController
|
|||
|
||||
def show
|
||||
#待办事项,现在未做
|
||||
if User.current.login == @user.login
|
||||
if User.current.admin? || User.current.login == @user.login
|
||||
@waiting_applied_messages = @user.applied_messages.waiting
|
||||
@common_applied_transfer_projects = AppliedTransferProject.where(owner_id: @user.id).common + AppliedTransferProject.where(owner_id: Organization.joins(team_users: :team).where(team_users: {user_id: @user.id}, teams: {authorize: %w(admin owner)} )).common
|
||||
@undo_events = @waiting_applied_messages.size + @common_applied_transfer_projects.size
|
||||
@common_applied_projects = AppliedProject.where(project_id: @user.full_admin_projects).common
|
||||
@undo_events = @waiting_applied_messages.size + @common_applied_transfer_projects.size + @common_applied_projects.size
|
||||
else
|
||||
@waiting_applied_messages = AppliedMessage.none
|
||||
@common_applied_transfer_projects = AppliedTransferProject.none
|
||||
@common_applied_projects = AppliedProject.none
|
||||
@undo_events = 0
|
||||
end
|
||||
#用户的组织数量
|
||||
|
|
|
@ -1,5 +1,91 @@
|
|||
# Projects
|
||||
|
||||
## 申请加入项目
|
||||
申请加入项目
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3000/api/applied_projects.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('POST /api/appliedr_projects.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`POST /api/applied_projects.json`
|
||||
|
||||
### 请求参数
|
||||
参数 | 必选 | 默认 | 类型 | 字段说明
|
||||
--------- | ------- | ------- | -------- | ----------
|
||||
|applied_project.code |是| |string |邀请码 |
|
||||
|applied_project.role |否| |string |项目权限,reporter: 报告者, developer: 开发者,manager:管理员 |
|
||||
|
||||
> 请求的JSON示例
|
||||
|
||||
```json
|
||||
{
|
||||
"applied_project": {
|
||||
"code": "1una34",
|
||||
"role": "developer"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 返回字段说明
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|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示例:
|
||||
|
||||
```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分钟前"
|
||||
}
|
||||
```
|
||||
|
||||
## 获取项目列表
|
||||
获取项目列表,也可以更加相关条件过滤搜素
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!--
|
||||
* @Date: 2021-03-01 10:35:21
|
||||
* @LastEditors: viletyy
|
||||
* @LastEditTime: 2021-06-03 10:18:53
|
||||
* @LastEditTime: 2021-06-11 16:28:51
|
||||
* @FilePath: /forgeplus/app/docs/slate/source/includes/_users.md
|
||||
-->
|
||||
# Users
|
||||
|
@ -1002,11 +1002,11 @@ await octokit.request('GET /api/users/:login/applied_messages.json')
|
|||
|applied.user.name |string |通知主体的迁移创建者的名称 |
|
||||
|applied.user.login |string |通知主体的迁移创建者的标识 |
|
||||
|applied.user.image_url |string |通知主体的迁移创建者头像 |
|
||||
|applied.owner.id |int |通知主体的迁移接受者的id |
|
||||
|applied.owner.type |string |通知主体的迁移接受者的类型 |
|
||||
|applied.owner.name |string |通知主体的迁移接受者的名称 |
|
||||
|applied.owner.login |string |通知主体的迁移接受者的标识 |
|
||||
|applied.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_type |string |通知类型 |
|
||||
|name |string | 通知内容 |
|
||||
|viewed |string|是否已读,waiting:未读,viewed:已读|
|
||||
|
@ -1020,6 +1020,48 @@ await octokit.request('GET /api/users/:login/applied_messages.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": {
|
||||
|
@ -1344,4 +1386,240 @@ await octokit.request('GET /api/users/:login/applied_transfer_projects/:id/refus
|
|||
"created_at": "2021-04-25 18:06",
|
||||
"time_ago": "16小时前"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 待办事项-项目申请
|
||||
待办事项-项目申请
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET http://localhost:3000/api/users/yystopf/applied_projects.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/users/:login/applied_projects.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`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示例:
|
||||
|
||||
```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分钟前"
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 用户接受申请
|
||||
用户接受申请
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3000/api/users/yystopf/applied_projects/2/accept.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/users/:login/applied_projects/:id/accept.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`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示例:
|
||||
|
||||
```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分钟前"
|
||||
}
|
||||
```
|
||||
|
||||
## 用户拒绝申请
|
||||
用户拒绝申请
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3000/api/users/yystopf/applied_projects/2/refuse.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/users/:login/applied_projects/:id/refuse.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/users/:login/applied_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 |申请创建者头像 |
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```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分钟前"
|
||||
}
|
||||
```
|
|
@ -438,4 +438,14 @@ module ApplicationHelper
|
|||
return nil if str.blank?
|
||||
Base64.decode64 str
|
||||
end
|
||||
|
||||
def render_admin_statistics_item
|
||||
url = Rails.application.config_for(:configuration)["admin_statistics_url"]
|
||||
|
||||
return if url.blank?
|
||||
content_tag(:li) do
|
||||
sidebar_item(url, "数据统计", icon: 'bar-chart', controller: 'root')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -23,7 +23,7 @@ module Projects
|
|||
ActiveRecord::Base.transaction do
|
||||
gitea_result = Gitea::Repository::Members::AddService.new(owner, project.identifier, collaborator.login, permission).call
|
||||
if gitea_result.status == 204
|
||||
project.add_member!(collaborator.id)
|
||||
project.add_member!(collaborator.id, role_name)
|
||||
end
|
||||
fail!(nil)
|
||||
end
|
||||
|
@ -38,5 +38,20 @@ module Projects
|
|||
@error = error
|
||||
end
|
||||
|
||||
def role_name
|
||||
case permission
|
||||
when 'read'
|
||||
'Reporter'
|
||||
when 'write'
|
||||
'Developer'
|
||||
when 'admin'
|
||||
'Manager'
|
||||
when 'owner'
|
||||
'Manager'
|
||||
else
|
||||
'Reporter'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
class SendJoinProjectAppliedMessageJob < ApplicationJob
|
||||
queue_as :default
|
||||
|
||||
def perform(applied_project, applied_user, message_status)
|
||||
project = applied_project.project
|
||||
return unless project.present?
|
||||
return unless applied_user.present?
|
||||
return unless applied_project.user.present?
|
||||
AppliedMessage.find_or_create_by!(user_id: applied_project.user_id,
|
||||
applied: applied_project,
|
||||
status: message_status,
|
||||
name: build_name(project.name, message_status),
|
||||
applied_user_id: applied_user.id,
|
||||
project_id: project.id)
|
||||
end
|
||||
|
||||
private
|
||||
def build_name(repo_name, message_status, applied_name="")
|
||||
case message_status
|
||||
when 'successed'
|
||||
return "已通过你加入【#{repo_name}】仓库的申请。"
|
||||
when 'failure'
|
||||
return "已拒绝你加入【#{repo_name}】仓库的申请。"
|
||||
end
|
||||
""
|
||||
end
|
||||
end
|
|
@ -7,6 +7,8 @@
|
|||
# user_id :integer not null
|
||||
# role :integer default("0")
|
||||
# status :integer default("0")
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
#
|
||||
|
||||
class AppliedProject < ApplicationRecord
|
||||
|
@ -14,7 +16,9 @@ class AppliedProject < ApplicationRecord
|
|||
belongs_to :project
|
||||
|
||||
has_many :applied_messages, as: :applied, dependent: :destroy
|
||||
has_many :forge_activities, as: :forge_act, dependent: :destroy
|
||||
# has_many :forge_activities, as: :forge_act, dependent: :destroy
|
||||
|
||||
enum role: {manager: 3, developer: 4, reporter: 5}
|
||||
enum status: {canceled: -1, common: 0, accepted: 1, refused: 2} # -1 已取消 0 待操作 1 已接收 2 已拒绝
|
||||
|
||||
scope :pending, -> { where(status: 0) }
|
||||
end
|
||||
|
|
|
@ -1,41 +1,42 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: attachments
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# container_id :integer
|
||||
# container_type :string(30)
|
||||
# filename :string(255) default(""), not null
|
||||
# disk_filename :string(255) default(""), not null
|
||||
# filesize :integer default("0"), not null
|
||||
# content_type :string(255) default("")
|
||||
# digest :string(60) default(""), not null
|
||||
# downloads :integer default("0"), not null
|
||||
# author_id :integer default("0"), not null
|
||||
# created_on :datetime
|
||||
# description :text(65535)
|
||||
# disk_directory :string(255)
|
||||
# attachtype :integer default("1")
|
||||
# is_public :integer default("1")
|
||||
# copy_from :integer
|
||||
# quotes :integer default("0")
|
||||
# is_publish :integer default("1")
|
||||
# publish_time :datetime
|
||||
# resource_bank_id :integer
|
||||
# unified_setting :boolean default("1")
|
||||
# cloud_url :string(255) default("")
|
||||
# course_second_category_id :integer default("0")
|
||||
# delay_publish :boolean default("0")
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_attachments_on_author_id (author_id)
|
||||
# index_attachments_on_container_id_and_container_type (container_id,container_type)
|
||||
# index_attachments_on_course_second_category_id (course_second_category_id)
|
||||
# index_attachments_on_created_on (created_on)
|
||||
# index_attachments_on_is_public (is_public)
|
||||
# index_attachments_on_quotes (quotes)
|
||||
#
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: attachments
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# container_id :integer
|
||||
# container_type :string(30)
|
||||
# filename :string(255) default(""), not null
|
||||
# disk_filename :string(255) default(""), not null
|
||||
# filesize :integer default("0"), not null
|
||||
# content_type :string(255) default("")
|
||||
# digest :string(60) default(""), not null
|
||||
# downloads :integer default("0"), not null
|
||||
# author_id :integer default("0"), not null
|
||||
# created_on :datetime
|
||||
# description :text(65535)
|
||||
# disk_directory :string(255)
|
||||
# attachtype :integer default("1")
|
||||
# is_public :integer default("1")
|
||||
# copy_from :integer
|
||||
# quotes :integer default("0")
|
||||
# is_publish :integer default("1")
|
||||
# publish_time :datetime
|
||||
# resource_bank_id :integer
|
||||
# unified_setting :boolean default("1")
|
||||
# cloud_url :string(255) default("")
|
||||
# course_second_category_id :integer default("0")
|
||||
# delay_publish :boolean default("0")
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_attachments_on_author_id (author_id)
|
||||
# index_attachments_on_container_id_and_container_type (container_id,container_type)
|
||||
# index_attachments_on_course_second_category_id (course_second_category_id)
|
||||
# index_attachments_on_created_on (created_on)
|
||||
# index_attachments_on_is_public (is_public)
|
||||
# index_attachments_on_quotes (quotes)
|
||||
#
|
||||
|
||||
|
||||
class Attachment < ApplicationRecord
|
||||
include BaseModel
|
||||
|
|
|
@ -46,6 +46,10 @@
|
|||
# is_sync_pwd :boolean default("1")
|
||||
# watchers_count :integer default("0")
|
||||
# devops_step :integer default("0")
|
||||
# sponsor_certification :integer default("0")
|
||||
# sponsor_num :integer default("0")
|
||||
# sponsored_num :integer default("0")
|
||||
# award_time :datetime
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
module Dcodes
|
||||
DCODES = %W(1 2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
|
||||
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def generate_dcode(field, num, pre='')
|
||||
code = DCODES.sample(num).join
|
||||
while self.class.exists?("#{field}": pre+code) do
|
||||
code = DCODES.sample(num).join
|
||||
end
|
||||
code
|
||||
end
|
||||
|
||||
def init_project_invite_code
|
||||
while Project.where(invite_code: nil).size > 0 do
|
||||
projects = Project.where(invite_code: nil).limit(1000)
|
||||
set_sql = ""
|
||||
projects.each do |p|
|
||||
set_sql += "WHEN #{p.id} THEN '#{DCODES.sample(6).join}' "
|
||||
end
|
||||
sql = "UPDATE projects SET invite_code = CASE id "+ set_sql+ "END WHERE id IN(#{projects.ids.join(",")})"
|
||||
Project.connection.execute(sql)
|
||||
end
|
||||
repeat_codes = Project.group(:invite_code).count.select{|k,v| v>1}
|
||||
Project.where(invite_code: repeat_code.keys).update_all(invite_code: nil)
|
||||
end
|
||||
|
||||
end
|
|
@ -65,7 +65,7 @@ module ProjectOperable
|
|||
if owner.is_a?(User)
|
||||
managers.exists?(user_id: user.id)
|
||||
elsif owner.is_a?(Organization)
|
||||
managers.exists?(user_id: user.id) || owner.is_admin?(user.id)
|
||||
managers.exists?(user_id: user.id) || owner.is_only_admin?(user.id)
|
||||
else
|
||||
false
|
||||
end
|
||||
|
@ -76,7 +76,7 @@ module ProjectOperable
|
|||
if owner.is_a?(User)
|
||||
developers.exists?(user_id: user.id)
|
||||
elsif owner.is_a?(Organization)
|
||||
developers.exists?(user_id: user.id) || owner.is_write?(user.id)
|
||||
developers.exists?(user_id: user.id) || owner.is_only_write?(user.id)
|
||||
else
|
||||
false
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
# tracker_id :integer not null
|
||||
# project_id :integer not null
|
||||
# subject :string(255) default(""), not null
|
||||
# description :text(65535)
|
||||
# description :text(4294967295)
|
||||
# due_date :date
|
||||
# category_id :integer
|
||||
# status_id :integer not null
|
||||
|
@ -14,7 +14,6 @@
|
|||
# priority_id :integer not null
|
||||
# fixed_version_id :integer
|
||||
# author_id :integer not null
|
||||
# lock_version :integer default("0"), not null
|
||||
# created_on :datetime
|
||||
# updated_on :datetime
|
||||
# start_date :date
|
||||
|
@ -28,7 +27,7 @@
|
|||
# closed_on :datetime
|
||||
# project_issues_index :integer
|
||||
# issue_type :string(255)
|
||||
# token :string(255)
|
||||
# token :integer default("0")
|
||||
# issue_tags_value :string(255)
|
||||
# is_lock :boolean default("0")
|
||||
# issue_classify :string(255)
|
||||
|
@ -74,7 +73,7 @@ class Issue < ApplicationRecord
|
|||
scope :issue_issue, ->{where(issue_classify: [nil,"issue"])}
|
||||
scope :issue_pull_request, ->{where(issue_classify: "pull_request")}
|
||||
scope :issue_index_includes, ->{includes(:tracker, :priority, :version, :issue_status, :journals,:issue_tags,user: :user_extension)}
|
||||
|
||||
scope :closed, ->{where(status_id: 5)}
|
||||
after_update :change_versions_count
|
||||
after_save :reset_cache_data
|
||||
after_destroy :update_closed_issues_count_in_project!, :reset_cache_data
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
# content :text(65535)
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# is_secret :boolean default("0")
|
||||
#
|
||||
|
||||
class License < ApplicationRecord
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
# course_group_id :integer default("0")
|
||||
# is_collect :integer default("1")
|
||||
# graduation_group_id :integer default("0")
|
||||
# is_apply_signature :boolean default("0")
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
|
|
@ -46,6 +46,10 @@
|
|||
# is_sync_pwd :boolean default("1")
|
||||
# watchers_count :integer default("0")
|
||||
# devops_step :integer default("0")
|
||||
# sponsor_certification :integer default("0")
|
||||
# sponsor_num :integer default("0")
|
||||
# sponsored_num :integer default("0")
|
||||
# award_time :datetime
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
@ -106,6 +110,14 @@ class Organization < Owner
|
|||
team_users.joins(:team).where(user_id: user_id, teams: {authorize: %w(read write admin owner)}).present?
|
||||
end
|
||||
|
||||
def is_only_admin?(user_id)
|
||||
team_users.joins(:team).where(user_id: user_id, teams: {authorize: %w(admin)}).present?
|
||||
end
|
||||
|
||||
def is_only_write?(user_id)
|
||||
team_users.joins(:team).where(user_id: user_id, teams: {authorize: %w(write)}).present?
|
||||
end
|
||||
|
||||
def is_only_read?(user_id)
|
||||
team_users.joins(:team).where(user_id: user_id, teams: {authorize: %w(read)}).present?
|
||||
end
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
# == Schema Information
|
||||
#
|
||||
# Table name: praise_treads
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# user_id :integer not null
|
||||
# praise_tread_object_id :integer
|
||||
# praise_tread_object_type :string(255)
|
||||
# praise_or_tread :integer default("1")
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# praise_tread (praise_tread_object_id,praise_tread_object_type)
|
||||
#
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: praise_treads
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# user_id :integer not null
|
||||
# praise_tread_object_id :integer
|
||||
# praise_tread_object_type :string(255)
|
||||
# praise_or_tread :integer default("1")
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# praise_tread (praise_tread_object_id,praise_tread_object_type)
|
||||
#
|
||||
|
||||
|
||||
class PraiseTread < ApplicationRecord
|
||||
belongs_to :user
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# id :integer not null, primary key
|
||||
# name :string(255) default(""), not null
|
||||
# description :text(65535)
|
||||
# description :text(4294967295)
|
||||
# homepage :string(255) default("")
|
||||
# is_public :boolean default("1"), not null
|
||||
# parent_id :integer
|
||||
|
@ -43,6 +43,19 @@
|
|||
# watchers_count :integer default("0")
|
||||
# issues_count :integer default("0")
|
||||
# pull_requests_count :integer default("0")
|
||||
# language :string(255)
|
||||
# versions_count :integer default("0")
|
||||
# issue_tags_count :integer default("0")
|
||||
# closed_issues_count :integer default("0")
|
||||
# open_devops :boolean default("0")
|
||||
# gitea_webhook_id :integer
|
||||
# open_devops_count :integer default("0")
|
||||
# recommend :boolean default("0")
|
||||
# platform :integer default("0")
|
||||
# default_branch :string(255) default("master")
|
||||
# website :string(255)
|
||||
# order_index :integer default("0")
|
||||
# lesson_url :string(255)
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
@ -66,6 +79,7 @@ class Project < ApplicationRecord
|
|||
include Publicable
|
||||
include Watchable
|
||||
include ProjectOperable
|
||||
include Dcodes
|
||||
|
||||
# common:开源托管项目
|
||||
# mirror:普通镜像项目,没有定时同步功能
|
||||
|
@ -106,6 +120,7 @@ class Project < ApplicationRecord
|
|||
has_many :has_pinned_users, through: :pinned_projects, source: :user
|
||||
|
||||
after_save :check_project_members, :reset_cache_data
|
||||
before_save :set_invite_code
|
||||
after_destroy :reset_cache_data
|
||||
scope :project_statics_select, -> {select(:id,:name, :is_public, :identifier, :status, :project_type, :user_id, :forked_count, :visits, :project_category_id, :project_language_id, :license_id, :ignore_id, :watchers_count, :created_on)}
|
||||
scope :no_anomory_projects, -> {where("projects.user_id is not null and projects.user_id != ?", 2)}
|
||||
|
@ -123,6 +138,12 @@ class Project < ApplicationRecord
|
|||
self.reset_user_cache_async_job(self.owner)
|
||||
end
|
||||
|
||||
def set_invite_code
|
||||
if self.invite_code.nil?
|
||||
self.invite_code= self.generate_dcode('invite_code', 6)
|
||||
end
|
||||
end
|
||||
|
||||
def self.search_project(search)
|
||||
ransack(name_or_identifier_cont: search)
|
||||
end
|
||||
|
|
|
@ -16,6 +16,11 @@
|
|||
# head :string(255)
|
||||
# base :string(255)
|
||||
# issue_id :integer
|
||||
# fork_project_id :integer
|
||||
# is_original :boolean default("0")
|
||||
# comments_count :integer default("0")
|
||||
# commits_count :integer default("0")
|
||||
# files_count :integer default("0")
|
||||
#
|
||||
|
||||
class PullRequest < ApplicationRecord
|
||||
|
@ -33,6 +38,8 @@ class PullRequest < ApplicationRecord
|
|||
has_many :project_trends, as: :trend, dependent: :destroy
|
||||
has_many :attachments, as: :container, dependent: :destroy
|
||||
|
||||
scope :merged_and_closed, ->{where.not(status: 1)}
|
||||
|
||||
after_save :reset_cache_data
|
||||
after_destroy :reset_cache_data
|
||||
|
||||
|
|
|
@ -46,6 +46,10 @@
|
|||
# is_sync_pwd :boolean default("1")
|
||||
# watchers_count :integer default("0")
|
||||
# devops_step :integer default("0")
|
||||
# sponsor_certification :integer default("0")
|
||||
# sponsor_num :integer default("0")
|
||||
# sponsored_num :integer default("0")
|
||||
# award_time :datetime
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
|
@ -207,6 +211,13 @@ class User < Owner
|
|||
return Project.from("( #{ normal_projects} UNION #{ org_projects } ) AS projects").distinct
|
||||
end
|
||||
|
||||
# 用户管理的所有项目
|
||||
def full_admin_projects
|
||||
normal_projects = Project.joins(members: :roles).where(roles: {name: 'Manager'}, members: {user_id: self.id}).to_sql
|
||||
org_projects = Project.joins(teams: :team_users).where(teams: {authorize: %w(admin owner)}, team_users: {user_id: self.id}).to_sql
|
||||
return Project.from("( #{ normal_projects} UNION #{ org_projects } ) AS projects").distinct
|
||||
end
|
||||
|
||||
def name
|
||||
login
|
||||
end
|
||||
|
|
|
@ -29,6 +29,7 @@ class Version < ApplicationRecord
|
|||
belongs_to :user, optional: true
|
||||
|
||||
scope :version_includes, ->{includes(:issues, :user)}
|
||||
scope :closed, ->{where(status: 'closed')}
|
||||
|
||||
# def open_issues_count
|
||||
# issues.select(:id,:status_id).where(status_id: [1,2,3,4,6]).size
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
class Projects::AcceptJoinService < ApplicationService
|
||||
attr_accessor :applied_project, :owner
|
||||
attr_reader :user, :project
|
||||
|
||||
def initialize(user, applied_project)
|
||||
@user = user
|
||||
@project = applied_project.project
|
||||
@applied_project = applied_project
|
||||
end
|
||||
|
||||
def call
|
||||
Rails.logger.info("###### Project accept_join_service begin ######")
|
||||
ActiveRecord::Base.transaction do
|
||||
validate!
|
||||
update_apply
|
||||
operate_project_member
|
||||
send_apply_message
|
||||
end
|
||||
|
||||
Rails.logger.info("##### Project accept_join_service end ######")
|
||||
|
||||
|
||||
return @applied_project
|
||||
end
|
||||
|
||||
private
|
||||
def permission
|
||||
case @applied_project.role
|
||||
when 'manager'
|
||||
'admin'
|
||||
when 'developer'
|
||||
'write'
|
||||
when 'reporter'
|
||||
'read'
|
||||
else
|
||||
'read'
|
||||
end
|
||||
end
|
||||
|
||||
def validate!
|
||||
raise Error, '该申请已经被接受' if @applied_project.accepted?
|
||||
raise Error, '该申请不存在' unless @applied_project.present?
|
||||
raise Error, '未拥有接受申请权限' unless is_permit_operator
|
||||
end
|
||||
|
||||
def is_permit_operator
|
||||
return @user.admin? || @project.manager?(@user)
|
||||
end
|
||||
|
||||
def update_apply
|
||||
@applied_project.update!(status: 'accepted')
|
||||
end
|
||||
|
||||
def operate_project_member
|
||||
Projects::AddMemberInteractor.call(@project.owner, @project, @applied_project.user, permission)
|
||||
end
|
||||
|
||||
def send_apply_message
|
||||
SendJoinProjectAppliedMessageJob.perform_now(@applied_project, @user, 'successed')
|
||||
end
|
||||
end
|
|
@ -9,32 +9,31 @@ class Projects::ApplyJoinService < ApplicationService
|
|||
end
|
||||
|
||||
def call
|
||||
validate!
|
||||
|
||||
# 项目报告人员直接加入项目
|
||||
if params[:role] == 'reporter'
|
||||
# Projects::JoinService.call(project, user, role: 'reporter')
|
||||
return project
|
||||
end
|
||||
# if params[:role] == 'reporter'
|
||||
# # Projects::JoinService.call(project, user, role: 'reporter')
|
||||
# return project
|
||||
# end
|
||||
|
||||
ActiveRecord::Base.transaction do
|
||||
validate!
|
||||
apply = user.applied_projects.create!(project: project, role: role_value)
|
||||
apply
|
||||
# apply.forge_activities.find_or_create_by!(user: user, project: project)
|
||||
|
||||
apply.forge_activities.find_or_create_by!(user: user, project: project)
|
||||
|
||||
notify_project_manager!(apply)
|
||||
# notify_project_manager!(apply)
|
||||
end
|
||||
|
||||
# notify_project_owner
|
||||
ApplyJoinProjectNotifyJob.perform_later(user.id, project.id, role_value)
|
||||
# ApplyJoinProjectNotifyJob.perform_later(user.id, project.id, role_value)
|
||||
|
||||
project
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def project
|
||||
@_project ||= Project.find_by(invite_code: params[:code].to_s.strip)
|
||||
@_project ||= Project.find_by('binary(invite_code) = ? ',"#{params[:code].to_s.strip}")
|
||||
end
|
||||
|
||||
def role_value
|
||||
|
@ -43,7 +42,8 @@ class Projects::ApplyJoinService < ApplicationService
|
|||
when 'manager' then 3
|
||||
when 'developer' then 4
|
||||
when 'reporter' then 5
|
||||
else raise Error, '角色无效'
|
||||
else
|
||||
5
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -74,12 +74,18 @@ class Projects::ApplyJoinService < ApplicationService
|
|||
def validate!
|
||||
# params check
|
||||
raise Error, '邀请码不能为空' if params[:code].blank?
|
||||
raise Error, '角色不能为空' if params[:role].blank?
|
||||
raise Error, '角色无效' unless %w(manager developer reporter).include?(params[:role])
|
||||
raise Error, '请输入6位项目邀请码' unless valid_invite_code( params[:code])
|
||||
|
||||
# logical check
|
||||
raise Error, '邀请码无效' if project.blank?
|
||||
raise Error, '您已在该项目中' if project.member?(user)
|
||||
raise Error, '您已经提交过申请' if user.applied_projects.pending.exists?(project: project)
|
||||
raise Error, '您已是项目成员' if project.member?(user)
|
||||
raise Error, '您已经提交过申请' if user.applied_projects.common.exists?(project: project)
|
||||
end
|
||||
|
||||
def valid_invite_code(str)
|
||||
if (str =~ /^[A-Za-z0-9]{6}+$/)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
|
@ -0,0 +1,39 @@
|
|||
class Projects::RefuseJoinService < ApplicationService
|
||||
attr_accessor :applied_project, :owner
|
||||
attr_reader :user, :project
|
||||
|
||||
def initialize(user, applied_project)
|
||||
@user = user
|
||||
@project = applied_project.project
|
||||
@applied_project = applied_project
|
||||
end
|
||||
|
||||
def call
|
||||
Rails.logger.info("###### Project refuse_join_service begin ######")
|
||||
validate!
|
||||
update_apply
|
||||
send_apply_message
|
||||
Rails.logger.info("###### Project refuse_join_service end ######")
|
||||
|
||||
return @applied_project
|
||||
end
|
||||
|
||||
private
|
||||
def validate!
|
||||
raise Error, '该申请已被拒绝' if @applied_project.refused?
|
||||
raise Error, '该申请不存在' unless @applied_project.present?
|
||||
raise Error, '未拥有接受申请权限' unless is_permit_operator
|
||||
end
|
||||
|
||||
def is_permit_operator
|
||||
return @user.admin? || @project.manager?(@user)
|
||||
end
|
||||
|
||||
def update_apply
|
||||
@applied_project.update!(status: 'refused')
|
||||
end
|
||||
|
||||
def send_apply_message
|
||||
SendJoinProjectAppliedMessageJob.perform_now(@applied_project, @user, 'failure')
|
||||
end
|
||||
end
|
|
@ -42,8 +42,11 @@
|
|||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= sidebar_item('/admins/sidekiq', '定时任务', icon: 'bell', controller: 'root') %>
|
||||
<%= sidebar_item('/admins/sidekiq', '定时任务', icon: 'bell', controller: 'root') %>
|
||||
</li>
|
||||
|
||||
<%= render_admin_statistics_item %>
|
||||
|
||||
<li><%= sidebar_item('/', '返回主站', icon: 'sign-out', controller: 'root') %></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
project = object.project
|
||||
json.project do
|
||||
json.id project.id
|
||||
json.identifier project.identifier
|
||||
json.name project.name
|
||||
json.description project.description
|
||||
json.is_public project.is_public
|
||||
json.owner do
|
||||
json.partial! "/users/user_simple", locals: {user: project.owner}
|
||||
end
|
||||
end
|
||||
json.user do
|
||||
json.partial! "/users/user_simple", locals: {user: object.user}
|
||||
end
|
||||
json.id object.id
|
||||
json.status object.status
|
||||
json.role object.role
|
||||
json.created_at format_time(object.created_at)
|
||||
json.time_ago time_from_now(object.created_at)
|
|
@ -0,0 +1 @@
|
|||
json.partial! "detail", locals: {object: @applied_project}
|
|
@ -7,12 +7,13 @@ else
|
|||
json.readme @result[:readme].merge(content: readme_render_decode64_content(@result[:readme]["content"], nil))
|
||||
end
|
||||
json.identifier render_identifier(@project)
|
||||
json.invite_code @project.invite_code
|
||||
json.name @project.name
|
||||
json.description @project.description
|
||||
json.project_id @project.id
|
||||
json.repo_id @repository.id
|
||||
json.issues_count @project.issues_count.to_i - @project.pull_requests_count.to_i
|
||||
json.pull_requests_count @project.pull_requests_count
|
||||
json.pull_requests_count @project.pull_requests_count
|
||||
json.project_identifier render_identifier(@project)
|
||||
json.praises_count @project.praises_count.to_i
|
||||
json.forked_count @project.forked_count.to_i
|
||||
|
|
|
@ -13,7 +13,12 @@
|
|||
# json.partial! "/users/user_simple", locals: {user: object.user}
|
||||
# end
|
||||
json.applied do
|
||||
json.partial! "/projects/applied_transfer_projects/detail", locals: {object: object.applied}
|
||||
case object.applied_type
|
||||
when 'AppliedTransferProject'
|
||||
json.partial! "/projects/applied_transfer_projects/detail", locals: {object: object.applied}
|
||||
when 'AppliedProject'
|
||||
json.partial! "/applied_projects/detail", locals: {object: object.applied}
|
||||
end
|
||||
end
|
||||
json.applied_user do
|
||||
json.partial! "/users/user_simple", locals: {user: object.applied_user}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
json.partial! "/applied_projects/detail", locals: {object: @applied_project}
|
|
@ -0,0 +1,4 @@
|
|||
json.total_count @applied_projects.total_count
|
||||
json.applied_projects @applied_projects do |apply|
|
||||
json.partial! "/applied_projects/detail", locals: {object: apply}
|
||||
end
|
|
@ -0,0 +1 @@
|
|||
json.partial! "/applied_projects/detail", locals: {object: @applied_project}
|
|
@ -1,6 +1,7 @@
|
|||
json.partial! 'users/user', locals: { user: @user }
|
||||
json.undo_messages @waiting_applied_messages.size
|
||||
json.undo_transfer_projects @common_applied_transfer_projects.size
|
||||
json.undo_join_projects @common_applied_projects.size
|
||||
json.undo_events @undo_events
|
||||
json.user_composes_count @user_composes_count
|
||||
json.user_org_count @user_org_count
|
||||
|
|
|
@ -148,6 +148,8 @@ Rails.application.routes.draw do
|
|||
resources :issue_depends, only: [:create, :destroy]
|
||||
end
|
||||
|
||||
resources :applied_projects, only: [:create]
|
||||
|
||||
resources :project_categories, only: [:index, :show] do
|
||||
get :group_list, on: :collection
|
||||
end
|
||||
|
@ -266,6 +268,12 @@ Rails.application.routes.draw do
|
|||
post :refuse
|
||||
end
|
||||
end
|
||||
resources :applied_projects, only: [:index] do
|
||||
member do
|
||||
post :accept
|
||||
post :refuse
|
||||
end
|
||||
end
|
||||
resources :headmaps, only: [:index]
|
||||
resources :is_pinned_projects, only: [:index, :update] do
|
||||
collection do
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddTimestampToAppliedProjects < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_timestamps(:applied_projects, null: true)
|
||||
end
|
||||
end
|
|
@ -373,11 +373,23 @@
|
|||
<li>
|
||||
<a href="#5e6ed41015" class="toc-h2 toc-link" data-title="用户拒绝迁移">用户拒绝迁移</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#ba97e431b8" class="toc-h2 toc-link" data-title="待办事项-项目申请">待办事项-项目申请</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#e8ec937c34" class="toc-h2 toc-link" data-title="用户接受申请">用户接受申请</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#f2ee84ecf7" class="toc-h2 toc-link" data-title="用户拒绝申请">用户拒绝申请</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#projects" class="toc-h1 toc-link" data-title="Projects">Projects</a>
|
||||
<ul class="toc-list-h2">
|
||||
<li>
|
||||
<a href="#ac55469b06" class="toc-h2 toc-link" data-title="申请加入项目">申请加入项目</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#bfdfb34952" class="toc-h2 toc-link" data-title="获取项目列表">获取项目列表</a>
|
||||
</li>
|
||||
|
@ -617,7 +629,7 @@ Success — a happy kitten is an authenticated kitten!
|
|||
<!--
|
||||
* @Date: 2021-03-01 10:35:21
|
||||
* @LastEditors: viletyy
|
||||
* @LastEditTime: 2021-06-03 10:18:53
|
||||
* @LastEditTime: 2021-06-11 16:28:51
|
||||
* @FilePath: /forgeplus/app/docs/slate/source/includes/_users.md
|
||||
-->
|
||||
<h1 id='users'>Users</h1><h2 id='1ae74893b1'>获取当前登陆用户信息</h2>
|
||||
|
@ -2016,29 +2028,29 @@ Success — a happy kitten is an authenticated kitten!
|
|||
<td>通知主体的迁移创建者头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>applied.owner.id</td>
|
||||
<td>applied_user.id</td>
|
||||
<td>int</td>
|
||||
<td>通知主体的迁移接受者的id</td>
|
||||
<td>通知发起者的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>applied.owner.type</td>
|
||||
<td>applied_user.type</td>
|
||||
<td>string</td>
|
||||
<td>通知主体的迁移接受者的类型</td>
|
||||
<td>通知发起者的类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>applied.owner.name</td>
|
||||
<td>applied_user.name</td>
|
||||
<td>string</td>
|
||||
<td>通知主体的迁移接受者的名称</td>
|
||||
<td>通知发起者的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>applied.owner.login</td>
|
||||
<td>applied_user.login</td>
|
||||
<td>string</td>
|
||||
<td>通知主体的迁移接受者的标识</td>
|
||||
<td>通知发起者的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>applied.owner.image_url</td>
|
||||
<td>applied_user.image_url</td>
|
||||
<td>string</td>
|
||||
<td>通知主体的迁移接受者头像</td>
|
||||
<td>通知发起者头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>applied_type</td>
|
||||
|
@ -2073,6 +2085,48 @@ Success — a happy kitten is an authenticated kitten!
|
|||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"total_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"applied_messages"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"applied"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">74</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"wwww"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"is_public"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"owner"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"system/lets/letter_avatars/2/T/19_237_174/120.png"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"何慧"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"yystopf"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"images/avatars/User/6?t=1622513134"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"accepted"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-06-09 16:34"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_ago"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1分钟前"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"applied_user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"何慧"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"yystopf"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"images/avatars/User/6?t=1622513134"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"applied_type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"AppliedProject"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"已通过你加入【hehuisssjssjjsjs】仓库的申请。"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"viewed"</span><span class="p">:</span><span class="w"> </span><span class="s2">"waiting"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"successed"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-06-09 16:34"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_ago"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1分钟前"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"applied"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
|
@ -2699,7 +2753,660 @@ Success — a happy kitten is an authenticated kitten!
|
|||
</span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-04-25 18:06"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_ago"</span><span class="p">:</span><span class="w"> </span><span class="s2">"16小时前"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h1 id='projects'>Projects</h1><h2 id='bfdfb34952'>获取项目列表</h2>
|
||||
</span></code></pre></div><h2 id='ba97e431b8'>待办事项-项目申请</h2>
|
||||
<p>待办事项-项目申请</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/users/yystopf/applied_projects.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-16'>HTTP 请求</h3>
|
||||
<p><code>GET /api/users/:login/applied_projects.json</code></p>
|
||||
<h3 id='aa883f5d52-13'>请求字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>login</td>
|
||||
<td>string</td>
|
||||
<td>用户标识</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='7447e4874e-13'>返回字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>int</td>
|
||||
<td>申请id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>status</td>
|
||||
<td>string</td>
|
||||
<td>申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>time_ago</td>
|
||||
<td>string</td>
|
||||
<td>申请创建的时间</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.id</td>
|
||||
<td>int</td>
|
||||
<td>申请项目的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.identifier</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.name</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.description</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的描述</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.is_public</td>
|
||||
<td>bool</td>
|
||||
<td>申请项目是否公开</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.id</td>
|
||||
<td>bool</td>
|
||||
<td>申请项目拥有者id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.type</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.name</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者昵称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.login</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.image_url</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.id</td>
|
||||
<td>int</td>
|
||||
<td>申请创建者的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.type</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.name</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.login</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.image_url</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者头像</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"total_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"applied_transfer_projects"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">74</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"wwww"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"is_public"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"owner"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"system/lets/letter_avatars/2/T/19_237_174/120.png"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"何慧"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"yystopf"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"images/avatars/User/6?t=1622513134"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">7</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"common"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-06-09 16:41"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_ago"</span><span class="p">:</span><span class="w"> </span><span class="s2">"7分钟前"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="err">...</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h2 id='e8ec937c34'>用户接受申请</h2>
|
||||
<p>用户接受申请</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_projects/2/accept.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects/:id/accept.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-17'>HTTP 请求</h3>
|
||||
<p><code>GET /api/users/:login/applied_projects/:id/accept.json</code></p>
|
||||
<h3 id='aa883f5d52-14'>请求字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>login</td>
|
||||
<td>string</td>
|
||||
<td>用户标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>int</td>
|
||||
<td>申请id</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='7447e4874e-14'>返回字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>int</td>
|
||||
<td>申请id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>status</td>
|
||||
<td>string</td>
|
||||
<td>申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>time_ago</td>
|
||||
<td>string</td>
|
||||
<td>申请创建的时间</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.id</td>
|
||||
<td>int</td>
|
||||
<td>申请项目的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.identifier</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.name</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.description</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的描述</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.is_public</td>
|
||||
<td>bool</td>
|
||||
<td>申请项目是否公开</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.id</td>
|
||||
<td>bool</td>
|
||||
<td>申请项目拥有者id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.type</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.name</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者昵称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.login</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.image_url</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.id</td>
|
||||
<td>int</td>
|
||||
<td>申请创建者的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.type</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.name</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.login</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.image_url</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者头像</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">74</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"wwww"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"is_public"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"owner"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"system/lets/letter_avatars/2/T/19_237_174/120.png"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"何慧"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"yystopf"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"images/avatars/User/6?t=1622513134"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">7</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"accept"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-06-09 16:41"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_ago"</span><span class="p">:</span><span class="w"> </span><span class="s2">"7分钟前"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h2 id='f2ee84ecf7'>用户拒绝申请</h2>
|
||||
<p>用户拒绝申请</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/users/yystopf/applied_projects/2/refuse.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/users/:login/applied_projects/:id/refuse.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-18'>HTTP 请求</h3>
|
||||
<p><code>GET /api/users/:login/applied_projects/:id/refuse.json</code></p>
|
||||
<h3 id='aa883f5d52-15'>请求字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>login</td>
|
||||
<td>string</td>
|
||||
<td>用户标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>int</td>
|
||||
<td>申请id</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='7447e4874e-15'>返回字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>int</td>
|
||||
<td>申请id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>status</td>
|
||||
<td>string</td>
|
||||
<td>申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>time_ago</td>
|
||||
<td>string</td>
|
||||
<td>申请创建的时间</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.id</td>
|
||||
<td>int</td>
|
||||
<td>申请项目的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.identifier</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.name</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.description</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的描述</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.is_public</td>
|
||||
<td>bool</td>
|
||||
<td>申请项目是否公开</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.id</td>
|
||||
<td>bool</td>
|
||||
<td>申请项目拥有者id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.type</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.name</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者昵称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.login</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.image_url</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.id</td>
|
||||
<td>int</td>
|
||||
<td>申请创建者的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.type</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.name</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.login</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.image_url</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者头像</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">74</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"wwww"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"is_public"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"owner"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"system/lets/letter_avatars/2/T/19_237_174/120.png"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"何慧"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"yystopf"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"images/avatars/User/6?t=1622513134"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">7</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"accept"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-06-09 16:41"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_ago"</span><span class="p">:</span><span class="w"> </span><span class="s2">"7分钟前"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h1 id='projects'>Projects</h1><h2 id='ac55469b06'>申请加入项目</h2>
|
||||
<p>申请加入项目</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/applied_projects.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/appliedr_projects.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http'>HTTP 请求</h3>
|
||||
<p><code>POST /api/applied_projects.json</code></p>
|
||||
<h3 id='1f9ac54b15'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>必选</th>
|
||||
<th>默认</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>applied_project.code</td>
|
||||
<td>是</td>
|
||||
<td></td>
|
||||
<td>string</td>
|
||||
<td>邀请码</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>applied_project.role</td>
|
||||
<td>否</td>
|
||||
<td></td>
|
||||
<td>string</td>
|
||||
<td>项目权限,reporter: 报告者, developer: 开发者,manager:管理员</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>请求的JSON示例</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"applied_project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"code"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1una34"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"role"</span><span class="p">:</span><span class="w"> </span><span class="s2">"developer"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h3 id='b302a98fa6'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>int</td>
|
||||
<td>申请id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>status</td>
|
||||
<td>string</td>
|
||||
<td>申请状态,canceled:取消,common:正在申请, accept:已接受,refuse:已拒绝</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>time_ago</td>
|
||||
<td>string</td>
|
||||
<td>项目申请创建的时间</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.id</td>
|
||||
<td>int</td>
|
||||
<td>申请项目的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.identifier</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.name</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.description</td>
|
||||
<td>string</td>
|
||||
<td>申请项目的描述</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.is_public</td>
|
||||
<td>bool</td>
|
||||
<td>申请项目是否公开</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.id</td>
|
||||
<td>bool</td>
|
||||
<td>申请项目拥有者id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.type</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.name</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者昵称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.login</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>project.owner.image_url</td>
|
||||
<td>string</td>
|
||||
<td>申请项目拥有者头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.id</td>
|
||||
<td>int</td>
|
||||
<td>申请创建者的id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.type</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的类型</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.name</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.login</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者的标识</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>user.image_url</td>
|
||||
<td>string</td>
|
||||
<td>申请创建者头像</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"project"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">74</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"hehuisssjssjjsjs"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"wwww"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"is_public"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"owner"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"testforge1"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"system/lets/letter_avatars/2/T/19_237_174/120.png"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"何慧"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"yystopf"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"images/avatars/User/6?t=1622513134"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">7</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"common"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-06-09 16:41"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_ago"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1分钟前"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h2 id='bfdfb34952'>获取项目列表</h2>
|
||||
<p>获取项目列表,也可以更加相关条件过滤搜素</p>
|
||||
|
||||
<blockquote>
|
||||
|
@ -2710,9 +3417,9 @@ Success — a happy kitten is an authenticated kitten!
|
|||
<span class="nt">-d</span> <span class="s2">"limit=5"</span> <span class="se">\</span>
|
||||
http://localhost:3000/api/projects | jq
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/projects</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-2'>HTTP 请求</h3>
|
||||
<p><code>GET api/projects</code></p>
|
||||
<h3 id='1f9ac54b15'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-2'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -2779,7 +3486,7 @@ http://localhost:3000/api/projects | jq
|
|||
<td>项目类型, 取值为:common、mirror; common:开源托管项目, mirror:开源镜像项目</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-2'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -2931,9 +3638,9 @@ Remember — a happy kitten is an authenticated kitten!
|
|||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET <span class="se">\</span>
|
||||
http://localhost:3000/api/projects/recommend | jq
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/projects/recommend.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-2'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-3'>HTTP 请求</h3>
|
||||
<p><code>GET api/projects/recommend</code></p>
|
||||
<h3 id='b302a98fa6-2'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-3'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3067,9 +3774,9 @@ Remember — a happy kitten is an authenticated kitten!
|
|||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET <span class="se">\</span>
|
||||
http://localhost:3000/api/yystopf/ceshi/menu_list | jq
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/yystopf/ceshi/menu_list</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-3'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-4'>HTTP 请求</h3>
|
||||
<p><code>GET api/:owner/:repo/menu_list</code></p>
|
||||
<h3 id='1f9ac54b15-2'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-3'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3094,7 +3801,7 @@ http://localhost:3000/api/yystopf/ceshi/menu_list | jq
|
|||
<td>项目标识identifier</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-3'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-4'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3135,9 +3842,9 @@ http://localhost:3000/api/yystopf/ceshi/menu_list | jq
|
|||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET <span class="se">\</span>
|
||||
http://localhost:3000/api/jasder/forgeplus/about | jq
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/jasder/forgeplus/about</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-4'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-5'>HTTP 请求</h3>
|
||||
<p><code>GET api/:owner/:repo/about</code></p>
|
||||
<h3 id='1f9ac54b15-3'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-4'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3162,7 +3869,7 @@ http://localhost:3000/api/jasder/forgeplus/about | jq
|
|||
<td>项目标识identifier</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-4'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-5'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3208,7 +3915,7 @@ Remember — a happy kitten is an authenticated kitten!
|
|||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET <span class="se">\</span>
|
||||
http://localhost:3000/api/yystopf/ceshi/project_units.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/yystopf/ceshi/project_units</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-5'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-6'>HTTP 请求</h3>
|
||||
<p><code>GET /api/yystopf/ceshi/project_units</code></p>
|
||||
<h3 id='7447e4874e'>返回字段说明:</h3>
|
||||
<table><thead>
|
||||
|
@ -3251,9 +3958,9 @@ http://localhost:3000/api/yystopf/ceshi/project_units.json
|
|||
<span class="nt">-d</span> <span class="s2">"{ </span><span class="se">\"</span><span class="s2">unit_typs</span><span class="se">\"</span><span class="s2">: [</span><span class="se">\"</span><span class="s2">code</span><span class="se">\"</span><span class="s2">, </span><span class="se">\"</span><span class="s2">pulls</span><span class="se">\"</span><span class="s2">]}"</span> <span class="se">\</span>
|
||||
http://localhost:3000/api/yystopf/ceshi/project_units.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/yystopf/ceshi/project_units</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-6'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-7'>HTTP 请求</h3>
|
||||
<p><code>POST /api/yystopf/ceshi/project_units</code></p>
|
||||
<h3 id='1f9ac54b15-4'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-5'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3315,9 +4022,9 @@ http://localhost:3000/api/yystopf/ceshi/project_units.json
|
|||
<span class="nt">-d</span> <span class="s2">"license_id=1"</span> <span class="se">\</span>
|
||||
http://localhost:3000/api/projects.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/projects.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-7'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-8'>HTTP 请求</h3>
|
||||
<p><code>POST api/projects</code></p>
|
||||
<h3 id='1f9ac54b15-5'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-6'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3391,7 +4098,7 @@ http://localhost:3000/api/projects.json
|
|||
<td>项目是否私有, true:为私有,false: 公开,默认为公开</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-5'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-6'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3433,9 +4140,9 @@ http://localhost:3000/api/projects.json
|
|||
<span class="nt">-d</span> <span class="s2">"project_language_id=2"</span> <span class="se">\</span>
|
||||
http://localhost:3000/api/projects/migrate.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/projects/migrate.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-8'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-9'>HTTP 请求</h3>
|
||||
<p><code>POST api/projects/migrate.json</code></p>
|
||||
<h3 id='1f9ac54b15-6'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-7'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3523,7 +4230,7 @@ http://localhost:3000/api/projects/migrate.json
|
|||
<td>项目是否私有, true:为私有,false: 非私有,默认为公开</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-6'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-7'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3558,9 +4265,9 @@ http://localhost:3000/api/projects/migrate.json
|
|||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/repositories/1244/sync_mirror.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/repositories/1244/sync_mirror.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-9'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-10'>HTTP 请求</h3>
|
||||
<p><code>POST api/repositories/:id/sync_mirror.json</code></p>
|
||||
<h3 id='1f9ac54b15-7'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-8'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3578,7 +4285,7 @@ http://localhost:3000/api/projects/migrate.json
|
|||
<td>仓库id</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-7'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-8'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3613,9 +4320,9 @@ http://localhost:3000/api/projects/migrate.json
|
|||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/jasder/forgeplus/forks.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/jaser/jasder_test/forks.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-10'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-11'>HTTP 请求</h3>
|
||||
<p><code>POST api/:owner/:repo/forks.json</code></p>
|
||||
<h3 id='1f9ac54b15-8'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-9'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3640,7 +4347,7 @@ http://localhost:3000/api/projects/migrate.json
|
|||
<td>项目标识identifier</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-8'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-9'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3676,9 +4383,9 @@ http://localhost:3000/api/projects/migrate.json
|
|||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET <span class="se">\</span>
|
||||
http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizations.json | jq
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/:owner/:repo/applied_transfer_projects/organizations</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-11'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-12'>HTTP 请求</h3>
|
||||
<p><code>GET api/:owner/:repo/applied_transfer_projects/organizations</code></p>
|
||||
<h3 id='1f9ac54b15-9'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-10'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3703,7 +4410,7 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat
|
|||
<td>项目标识identifier</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-9'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-10'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3770,9 +4477,9 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat
|
|||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/:owner/:repo/applied_transfer_projects.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-12'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-13'>HTTP 请求</h3>
|
||||
<p><code>POST /api/:owner/:repo/applied_transfer_projects.json</code></p>
|
||||
<h3 id='1f9ac54b15-10'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-11'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3804,7 +4511,7 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat
|
|||
<td>迁移对象标识</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-10'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-11'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -3974,9 +4681,9 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat
|
|||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/cancel.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">POST /api/:owner/:repo/applied_transfer_projects/cancel.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-13'>HTTP 请求</h3>
|
||||
</code></pre></div><h3 id='http-14'>HTTP 请求</h3>
|
||||
<p><code>POST /api/:owner/:repo/applied_transfer_projects/cancel.json</code></p>
|
||||
<h3 id='1f9ac54b15-11'>请求参数</h3>
|
||||
<h3 id='1f9ac54b15-12'>请求参数</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
@ -4001,7 +4708,7 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat
|
|||
<td>项目标识identifier</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='b302a98fa6-11'>返回字段说明</h3>
|
||||
<h3 id='b302a98fa6-12'>返回字段说明</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
|
|
Loading…
Reference in New Issue