docs: drawer
This commit is contained in:
parent
1559226837
commit
314155f115
1 changed files with 32 additions and 2 deletions
|
|
@ -31,6 +31,10 @@ if (!DEFAULT_INDEX) throw Error("Default ElasticSearch index must be specified."
|
||||||
|
|
||||||
@Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder")
|
@Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder")
|
||||||
export class FolderController extends Controller {
|
export class FolderController extends Controller {
|
||||||
|
/**
|
||||||
|
* @example cabinetName "ตู้เอกสาร 1"
|
||||||
|
* @example drawerName "ลิ้นชัก 1"
|
||||||
|
*/
|
||||||
@Get("/")
|
@Get("/")
|
||||||
@Tags("แฟ้ม")
|
@Tags("แฟ้ม")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
|
|
@ -50,6 +54,10 @@ export class FolderController extends Controller {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example cabinetName "ตู้เอกสาร 1"
|
||||||
|
* @example drawerName "ลิ้นชัก 1"
|
||||||
|
*/
|
||||||
@Post("/")
|
@Post("/")
|
||||||
@Tags("แฟ้ม")
|
@Tags("แฟ้ม")
|
||||||
@Security("bearerAuth", ["admin"])
|
@Security("bearerAuth", ["admin"])
|
||||||
|
|
@ -58,7 +66,13 @@ export class FolderController extends Controller {
|
||||||
@SuccessResponse(HttpStatusCode.CREATED, "สำเร็จ")
|
@SuccessResponse(HttpStatusCode.CREATED, "สำเร็จ")
|
||||||
public async createFolder(
|
public async createFolder(
|
||||||
@Request() request: { user: { preferred_username: string } },
|
@Request() request: { user: { preferred_username: string } },
|
||||||
@Body() body: { name: string },
|
@Body()
|
||||||
|
body: {
|
||||||
|
/**
|
||||||
|
* @example "แฟ้ม 1"
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
},
|
||||||
@Path() cabinetName: string,
|
@Path() cabinetName: string,
|
||||||
@Path() drawerName: string,
|
@Path() drawerName: string,
|
||||||
) {
|
) {
|
||||||
|
|
@ -80,13 +94,24 @@ export class FolderController extends Controller {
|
||||||
return this.setStatus(HttpStatusCode.CREATED);
|
return this.setStatus(HttpStatusCode.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example cabinetName "ตู้เอกสาร 1"
|
||||||
|
* @example drawerName "ลิ้นชัก 1"
|
||||||
|
* @example folderName "แฟ้ม 1"
|
||||||
|
*/
|
||||||
@Put("/{folderName}")
|
@Put("/{folderName}")
|
||||||
@Tags("แฟ้ม")
|
@Tags("แฟ้ม")
|
||||||
@Security("bearerAuth", ["admin"])
|
@Security("bearerAuth", ["admin"])
|
||||||
@Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดไม่สามารถย้ายไฟล์ได้")
|
@Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดไม่สามารถย้ายไฟล์ได้")
|
||||||
@SuccessResponse(HttpStatusCode.NO_CONTENT, "สำเร็จ")
|
@SuccessResponse(HttpStatusCode.NO_CONTENT, "สำเร็จ")
|
||||||
public async editFolder(
|
public async editFolder(
|
||||||
@Body() body: { name: string },
|
@Body()
|
||||||
|
body: {
|
||||||
|
/**
|
||||||
|
* @example "แฟ้มใหม่"
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
},
|
||||||
@Path() cabinetName: string,
|
@Path() cabinetName: string,
|
||||||
@Path() drawerName: string,
|
@Path() drawerName: string,
|
||||||
@Path() folderName: string,
|
@Path() folderName: string,
|
||||||
|
|
@ -139,6 +164,11 @@ export class FolderController extends Controller {
|
||||||
return this.setStatus(HttpStatusCode.NO_CONTENT);
|
return this.setStatus(HttpStatusCode.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @example cabinetName "ตู้เอกสาร 1"
|
||||||
|
* @example drawerName "ลิ้นชัก 1"
|
||||||
|
* @example folderName "แฟ้ม 1"
|
||||||
|
*/
|
||||||
@Delete("/{folderName}")
|
@Delete("/{folderName}")
|
||||||
@Tags("แฟ้ม")
|
@Tags("แฟ้ม")
|
||||||
@Security("bearerAuth", ["admin"])
|
@Security("bearerAuth", ["admin"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue