* 查询项目分组 * @interface /group/get * @method GET * @category group * @foldnumber 10 * @param {String} id 项目分组ID * @returns {Object} * @example
(ctx)
| 96 | * @example |
| 97 | */ |
| 98 | async get(ctx) { |
| 99 | let params = ctx.params; |
| 100 | |
| 101 | let groupInst = yapi.getInst(groupModel); |
| 102 | let result = await groupInst.getGroupById(params.id); |
| 103 | if (result) { |
| 104 | result = result.toObject(); |
| 105 | let role = await this.getProjectRole(params.id, 'group'); |
| 106 | result.role = role; |
| 107 | if (result.type === 'private') { |
| 108 | result.group_name = '个人空间'; |
| 109 | } |
| 110 | ctx.body = yapi.commons.resReturn(result); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * 添加项目分组 |
no test coverage detected