mirror of
https://github.com/certd/certd.git
synced 2026-05-18 06:17:31 +08:00
chore: 增加流水线,授权等文档
This commit is contained in:
@@ -28,7 +28,7 @@ export class UserProjectController extends BaseController {
|
||||
* @param body
|
||||
* @returns
|
||||
*/
|
||||
@Post('/detail', { description: Constants.per.authOnly })
|
||||
@Post('/detail', { description: Constants.per.authOnly, summary: "查询项目详情" })
|
||||
async detail(@Body(ALL) body: any) {
|
||||
const {projectId} = await this.getProjectUserIdRead();
|
||||
const res = await this.service.getDetail(projectId,this.getUserId());
|
||||
@@ -41,7 +41,7 @@ export class UserProjectController extends BaseController {
|
||||
* @param body
|
||||
* @returns
|
||||
*/
|
||||
@Post('/list', { description: Constants.per.authOnly })
|
||||
@Post('/list', { description: Constants.per.authOnly, summary: "查询我的项目列表" })
|
||||
async list(@Body(ALL) body: any) {
|
||||
const userId= this.getUserId();
|
||||
const res = await this.service.getUserProjects(userId);
|
||||
@@ -54,21 +54,21 @@ export class UserProjectController extends BaseController {
|
||||
* @param body 所有项目
|
||||
* @returns
|
||||
*/
|
||||
@Post('/all', { description: Constants.per.authOnly })
|
||||
@Post('/all', { description: Constants.per.authOnly, summary: "查询所有项目" })
|
||||
async all(@Body(ALL) body: any) {
|
||||
const userId= this.getUserId();
|
||||
const res = await this.service.getAllWithStatus(userId);
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/applyJoin', { description: Constants.per.authOnly })
|
||||
@Post('/applyJoin', { description: Constants.per.authOnly, summary: "申请加入项目" })
|
||||
async applyJoin(@Body(ALL) body: any) {
|
||||
const userId= this.getUserId();
|
||||
const res = await this.service.applyJoin({ userId, projectId: body.projectId });
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/updateMember', { description: Constants.per.authOnly })
|
||||
@Post('/updateMember', { description: Constants.per.authOnly, summary: "更新项目成员" })
|
||||
async updateMember(@Body(ALL) body: any) {
|
||||
const {projectId} = await this.getProjectUserIdAdmin();
|
||||
const {status,permission,userId} = body;
|
||||
@@ -89,7 +89,7 @@ export class UserProjectController extends BaseController {
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/approveJoin', { description: Constants.per.authOnly })
|
||||
@Post('/approveJoin', { description: Constants.per.authOnly, summary: "审批加入项目申请" })
|
||||
async approveJoin(@Body(ALL) body: any) {
|
||||
const {projectId} = await this.getProjectUserIdAdmin();
|
||||
const {status,permission,userId} = body;
|
||||
@@ -97,7 +97,7 @@ export class UserProjectController extends BaseController {
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/delete', { description: Constants.per.authOnly })
|
||||
@Post('/delete', { description: Constants.per.authOnly, summary: "删除项目成员" })
|
||||
async delete(@Body(ALL) body: any) {
|
||||
const {projectId} = await this.getProjectUserIdAdmin();
|
||||
await this.projectMemberService.deleteWhere({
|
||||
@@ -107,7 +107,7 @@ export class UserProjectController extends BaseController {
|
||||
return this.ok();
|
||||
}
|
||||
|
||||
@Post('/leave', { description: Constants.per.authOnly })
|
||||
@Post('/leave', { description: Constants.per.authOnly, summary: "离开项目" })
|
||||
async leave(@Body(ALL) body: any) {
|
||||
const {projectId} = body
|
||||
const userId = this.getUserId();
|
||||
|
||||
+7
-7
@@ -24,7 +24,7 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
|
||||
return this.service;
|
||||
}
|
||||
|
||||
@Post("/page", { description: Constants.per.authOnly })
|
||||
@Post("/page", { description: Constants.per.authOnly, summary: "查询项目成员分页列表" })
|
||||
async page(@Body(ALL) body: any) {
|
||||
const {projectId} = await this.getProjectUserIdRead();
|
||||
body.query = body.query ?? {};
|
||||
@@ -32,7 +32,7 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
|
||||
return await super.page(body);
|
||||
}
|
||||
|
||||
@Post("/list", { description: Constants.per.authOnly })
|
||||
@Post("/list", { description: Constants.per.authOnly, summary: "查询项目成员列表" })
|
||||
async list(@Body(ALL) body: any) {
|
||||
const {projectId} = await this.getProjectUserIdRead();
|
||||
body.query = body.query ?? {};
|
||||
@@ -40,7 +40,7 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
|
||||
return super.list(body);
|
||||
}
|
||||
|
||||
@Post("/add", { description: Constants.per.authOnly })
|
||||
@Post("/add", { description: Constants.per.authOnly, summary: "添加项目成员" })
|
||||
async add(@Body(ALL) bean: any) {
|
||||
const def: any = {
|
||||
isDefault: false,
|
||||
@@ -56,7 +56,7 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
|
||||
return super.add(bean);
|
||||
}
|
||||
|
||||
@Post("/update", { description: Constants.per.authOnly })
|
||||
@Post("/update", { description: Constants.per.authOnly, summary: "更新项目成员" })
|
||||
async update(@Body(ALL) bean: any) {
|
||||
if (!bean.id) {
|
||||
throw new Error("id is required");
|
||||
@@ -75,7 +75,7 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post("/info", { description: Constants.per.authOnly })
|
||||
@Post("/info", { description: Constants.per.authOnly, summary: "查询项目成员详情" })
|
||||
async info(@Query("id") id: number) {
|
||||
if (!id) {
|
||||
throw new Error("id is required");
|
||||
@@ -88,7 +88,7 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
|
||||
return super.info(id);
|
||||
}
|
||||
|
||||
@Post("/delete", { description: Constants.per.authOnly })
|
||||
@Post("/delete", { description: Constants.per.authOnly, summary: "删除项目成员" })
|
||||
async delete(@Query("id") id: number) {
|
||||
if (!id) {
|
||||
throw new Error("id is required");
|
||||
@@ -101,7 +101,7 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
|
||||
return super.delete(id);
|
||||
}
|
||||
|
||||
@Post("/deleteByIds", { description: Constants.per.authOnly })
|
||||
@Post("/deleteByIds", { description: Constants.per.authOnly, summary: "批量删除项目成员" })
|
||||
async deleteByIds(@Body("ids") ids: number[]) {
|
||||
for (const id of ids) {
|
||||
if (!id) {
|
||||
|
||||
@@ -22,7 +22,7 @@ export class TransferController extends BaseController {
|
||||
* @param body
|
||||
* @returns
|
||||
*/
|
||||
@Post('/selfResources', { description: Constants.per.authOnly })
|
||||
@Post('/selfResources', { description: Constants.per.authOnly, summary: "查询我自己的资源" })
|
||||
async selfResources() {
|
||||
const userId = this.getUserId();
|
||||
const res = await this.service.getUserResources(userId);
|
||||
@@ -34,7 +34,7 @@ export class TransferController extends BaseController {
|
||||
* @param body
|
||||
* @returns
|
||||
*/
|
||||
@Post('/doTransfer', { description: Constants.per.authOnly })
|
||||
@Post('/doTransfer', { description: Constants.per.authOnly, summary: "迁移项目资源" })
|
||||
async doTransfer() {
|
||||
const {projectId} = await this.getProjectUserIdRead();
|
||||
const userId = this.getUserId();
|
||||
|
||||
Reference in New Issue
Block a user