mirror of
https://github.com/certd/certd.git
synced 2026-07-14 17:53:28 +08:00
chore: 增加流水线,授权等文档
This commit is contained in:
@@ -20,7 +20,7 @@ export class GroupController extends CrudController<GroupService> {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post('/page', { description: Constants.per.authOnly })
|
||||
@Post('/page', { description: Constants.per.authOnly, summary: "查询分组分页列表" })
|
||||
async page(@Body(ALL) body: any) {
|
||||
const {projectId,userId} = await this.getProjectUserIdRead();
|
||||
body.query = body.query ?? {};
|
||||
@@ -38,7 +38,7 @@ export class GroupController extends CrudController<GroupService> {
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/list', { description: Constants.per.authOnly })
|
||||
@Post('/list', { description: Constants.per.authOnly, summary: "查询分组列表" })
|
||||
async list(@Body(ALL) body: any) {
|
||||
const {projectId,userId} = await this.getProjectUserIdRead();
|
||||
body.query = body.query ?? {};
|
||||
@@ -47,7 +47,7 @@ export class GroupController extends CrudController<GroupService> {
|
||||
return await super.list(body);
|
||||
}
|
||||
|
||||
@Post('/add', { description: Constants.per.authOnly })
|
||||
@Post('/add', { description: Constants.per.authOnly, summary: "添加分组" })
|
||||
async add(@Body(ALL) bean: any) {
|
||||
const {projectId,userId} = await this.getProjectUserIdRead();
|
||||
bean.projectId = projectId;
|
||||
@@ -55,26 +55,26 @@ export class GroupController extends CrudController<GroupService> {
|
||||
return await super.add(bean);
|
||||
}
|
||||
|
||||
@Post('/update', { description: Constants.per.authOnly })
|
||||
@Post('/update', { description: Constants.per.authOnly, summary: "更新分组" })
|
||||
async update(@Body(ALL) bean) {
|
||||
await this.checkOwner(this.getService(), bean.id, "write");
|
||||
delete bean.userId;
|
||||
delete bean.projectId;
|
||||
return await super.update(bean);
|
||||
}
|
||||
@Post('/info', { description: Constants.per.authOnly })
|
||||
@Post('/info', { description: Constants.per.authOnly, summary: "查询分组详情" })
|
||||
async info(@Query('id') id: number) {
|
||||
await this.checkOwner(this.getService(), id, "read");
|
||||
return await super.info(id);
|
||||
}
|
||||
|
||||
@Post('/delete', { description: Constants.per.authOnly })
|
||||
@Post('/delete', { description: Constants.per.authOnly, summary: "删除分组" })
|
||||
async delete(@Query('id') id: number) {
|
||||
await this.checkOwner(this.getService(), id, "write");
|
||||
return await super.delete(id);
|
||||
}
|
||||
|
||||
@Post('/all', { description: Constants.per.authOnly })
|
||||
@Post('/all', { description: Constants.per.authOnly, summary: "查询所有分组" })
|
||||
async all(@Query('type') type: string) {
|
||||
const {projectId,userId} = await this.getProjectUserIdRead();
|
||||
const list: any = await this.service.find({
|
||||
|
||||
@@ -25,7 +25,7 @@ export class BasicUserController extends BasicController {
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post('/getSimpleUserByIds', { description: Constants.per.authOnly })
|
||||
@Post('/getSimpleUserByIds', { description: Constants.per.authOnly, summary: "根据ID列表获取用户简单信息" })
|
||||
async getSimpleUserByIds(@Body('ids') ids: number[]) {
|
||||
if(!isEnterprise()){
|
||||
throw new Error('非企业模式不能获取用户信息');
|
||||
@@ -45,7 +45,7 @@ export class BasicUserController extends BasicController {
|
||||
return this.ok(users);
|
||||
}
|
||||
|
||||
@Post('/getSimpleUsers', {description: Constants.per.authOnly})
|
||||
@Post('/getSimpleUsers', {description: Constants.per.authOnly, summary: "获取所有用户简单信息"})
|
||||
async getSimpleUsers() {
|
||||
if(!isEnterprise()){
|
||||
throw new Error('非企业模式不能获取所有用户信息');
|
||||
@@ -62,7 +62,7 @@ export class BasicUserController extends BasicController {
|
||||
return this.ok(users);
|
||||
}
|
||||
|
||||
@Post('/getSimpleRoles', {description: Constants.per.authOnly})
|
||||
@Post('/getSimpleRoles', {description: Constants.per.authOnly, summary: "获取所有角色简单信息"})
|
||||
async getSimpleRoles() {
|
||||
const roles = await this.roleService.find({
|
||||
select: {
|
||||
|
||||
Reference in New Issue
Block a user