docs: word and order

This commit is contained in:
Methapon2001 2023-11-27 14:06:51 +07:00
parent 9b2bff6ba5
commit d8cf568206
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
10 changed files with 322 additions and 284 deletions

View file

@ -31,7 +31,7 @@ if (!DEFAULT_INDEX) throw Error("Default ElasticSearch index must be specified."
@Route("cabinet") @Route("cabinet")
export class CabinetController extends Controller { export class CabinetController extends Controller {
@Get("/") @Get("/")
@Tags("Cabinet") @Tags("ตู้เอกสาร")
@Security("bearerAuth") @Security("bearerAuth")
@Response( @Response(
HttpStatusCode.INTERNAL_SERVER_ERROR, HttpStatusCode.INTERNAL_SERVER_ERROR,
@ -48,7 +48,7 @@ export class CabinetController extends Controller {
} }
@Post("/") @Post("/")
@Tags("Cabinet") @Tags("ตู้เอกสาร")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดกับระบบจัดการไฟล์") @Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดกับระบบจัดการไฟล์")
@SuccessResponse(HttpStatusCode.CREATED, "สำเร็จ") @SuccessResponse(HttpStatusCode.CREATED, "สำเร็จ")
@ -69,7 +69,7 @@ export class CabinetController extends Controller {
} }
@Put("/{cabinetName}") @Put("/{cabinetName}")
@Tags("Cabinet") @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, "สำเร็จ")
@ -122,7 +122,7 @@ export class CabinetController extends Controller {
} }
@Delete("/{cabinetName}") @Delete("/{cabinetName}")
@Tags("Cabinet") @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, "สำเร็จ")

View file

@ -32,7 +32,7 @@ if (!DEFAULT_INDEX) throw Error("Default ElasticSearch index must be specified."
@Route("/cabinet/{cabinetName}/drawer") @Route("/cabinet/{cabinetName}/drawer")
export class DrawerController extends Controller { export class DrawerController extends Controller {
@Get("/") @Get("/")
@Tags("Drawer") @Tags("ลิ้นชัก")
@Security("bearerAuth") @Security("bearerAuth")
@Response( @Response(
HttpStatusCode.INTERNAL_SERVER_ERROR, HttpStatusCode.INTERNAL_SERVER_ERROR,
@ -49,7 +49,7 @@ export class DrawerController extends Controller {
} }
@Post("/") @Post("/")
@Tags("Drawer") @Tags("ลิ้นชัก")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@Response(HttpStatusCode.NOT_FOUND, "ไม่พบลิ้นชัก") @Response(HttpStatusCode.NOT_FOUND, "ไม่พบลิ้นชัก")
@Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดกับระบบจัดการไฟล์") @Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดกับระบบจัดการไฟล์")
@ -85,7 +85,7 @@ export class DrawerController extends Controller {
} }
@Put("/{drawerName}") @Put("/{drawerName}")
@Tags("Drawer") @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, "สำเร็จ")
@ -141,7 +141,7 @@ export class DrawerController extends Controller {
} }
@Delete("/{drawerName}") @Delete("/{drawerName}")
@Tags("Drawer") @Tags("ลิ้นชัก")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@SuccessResponse(HttpStatusCode.NO_CONTENT, "สำเร็จ") @SuccessResponse(HttpStatusCode.NO_CONTENT, "สำเร็จ")
public async deleteDrawer(@Path() cabinetName: string, @Path() drawerName: string) { public async deleteDrawer(@Path() cabinetName: string, @Path() drawerName: string) {

View file

@ -31,8 +31,39 @@ if (!DEFAULT_INDEX) throw Error("Default ElasticSearch index must be specified."
@Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file") @Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file")
export class FileController extends Controller { export class FileController extends Controller {
@Get("/")
@Tags("ไฟล์")
@Security("bearerAuth")
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
public async getFile(
@Path() cabinetName: string,
@Path() drawerName: string,
@Path() folderName: string,
): Promise<EhrFile[]> {
const search = await esClient.search<EhrFile & { attachment: Record<string, string> }>({
index: DEFAULT_INDEX!,
query: {
prefix: {
pathname: `${cabinetName}/${drawerName}/${folderName}/`,
},
},
size: 10000,
});
const records = search.hits.hits
.map((v) => {
if (v._source) {
const { attachment, ...rest } = v._source;
return rest satisfies EhrFile;
}
})
.filter((v: EhrFile | undefined): v is EhrFile => !!v);
return records;
}
@Post("/") @Post("/")
@Tags("File") @Tags("ไฟล์")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@Response( @Response(
HttpStatusCode.NOT_FOUND, HttpStatusCode.NOT_FOUND,
@ -112,39 +143,8 @@ export class FileController extends Controller {
}; };
} }
@Get("/")
@Tags("File")
@Security("bearerAuth")
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
public async getFile(
@Path() cabinetName: string,
@Path() drawerName: string,
@Path() folderName: string,
): Promise<EhrFile[]> {
const search = await esClient.search<EhrFile & { attachment: Record<string, string> }>({
index: DEFAULT_INDEX!,
query: {
prefix: {
pathname: `${cabinetName}/${drawerName}/${folderName}/`,
},
},
size: 10000,
});
const records = search.hits.hits
.map((v) => {
if (v._source) {
const { attachment, ...rest } = v._source;
return rest satisfies EhrFile;
}
})
.filter((v: EhrFile | undefined): v is EhrFile => !!v);
return records;
}
@Patch("/{fileName}") @Patch("/{fileName}")
@Tags("File") @Tags("ไฟล์")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@Response(HttpStatusCode.NOT_FOUND, "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม") @Response(HttpStatusCode.NOT_FOUND, "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม")
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") @SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
@ -243,7 +243,7 @@ export class FileController extends Controller {
} }
@Delete("/{fileName}") @Delete("/{fileName}")
@Tags("File") @Tags("ไฟล์")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") @SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
public async deleteFile( public async deleteFile(
@ -260,7 +260,7 @@ export class FileController extends Controller {
} }
@Get("/{fileName}") @Get("/{fileName}")
@Tags("Download") @Tags("ดาวน์โหลด")
@Security("bearerAuth") @Security("bearerAuth")
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") @SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
public async downloadFile( public async downloadFile(

View file

@ -32,7 +32,7 @@ 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 {
@Get("/") @Get("/")
@Tags("Folder") @Tags("แฟ้ม")
@Security("bearerAuth") @Security("bearerAuth")
@Response( @Response(
HttpStatusCode.INTERNAL_SERVER_ERROR, HttpStatusCode.INTERNAL_SERVER_ERROR,
@ -51,7 +51,7 @@ export class FolderController extends Controller {
} }
@Post("/") @Post("/")
@Tags("Folder") @Tags("แฟ้ม")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@Response(HttpStatusCode.NOT_FOUND, "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม") @Response(HttpStatusCode.NOT_FOUND, "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม")
@Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดกับระบบจัดการไฟล์") @Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดกับระบบจัดการไฟล์")
@ -88,7 +88,7 @@ export class FolderController extends Controller {
} }
@Put("/{folderName}") @Put("/{folderName}")
@Tags("Folder") @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, "สำเร็จ")
@ -145,7 +145,7 @@ export class FolderController extends Controller {
} }
@Delete("/{folderName}") @Delete("/{folderName}")
@Tags("Folder") @Tags("แฟ้ม")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@SuccessResponse(HttpStatusCode.NO_CONTENT, "สำเร็จ") @SuccessResponse(HttpStatusCode.NO_CONTENT, "สำเร็จ")
public async deleteFolder( public async deleteFolder(

View file

@ -11,7 +11,7 @@ if (!DEFAULT_INDEX) throw Error("Default ElasticSearch index must be specified."
@Route("/search") @Route("/search")
export class SearchController extends Controller { export class SearchController extends Controller {
@Post("/") @Post("/")
@Tags("Search") @Tags("ค้นหา")
@Security("bearerAuth") @Security("bearerAuth")
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") @SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
public async searchFile(@Body() search: Search): Promise<EhrFile[]> { public async searchFile(@Body() search: Search): Promise<EhrFile[]> {

View file

@ -32,7 +32,7 @@ if (!DEFAULT_INDEX) throw Error("Default ElasticSearch index must be specified."
@Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder") @Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder")
export class SubFolderController extends Controller { export class SubFolderController extends Controller {
@Get("/") @Get("/")
@Tags("SubFolder") @Tags("แฟ้มย่อย")
@Security("bearerAuth") @Security("bearerAuth")
@Response( @Response(
HttpStatusCode.INTERNAL_SERVER_ERROR, HttpStatusCode.INTERNAL_SERVER_ERROR,
@ -53,7 +53,7 @@ export class SubFolderController extends Controller {
} }
@Post("/") @Post("/")
@Tags("SubFolder") @Tags("แฟ้มย่อย")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@Response(HttpStatusCode.NOT_FOUND, "ไม่พบของแฟ้ม") @Response(HttpStatusCode.NOT_FOUND, "ไม่พบของแฟ้ม")
@Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดกับระบบจัดการไฟล์") @Response(HttpStatusCode.INTERNAL_SERVER_ERROR, "เกิดข้อผิดพลาดกับระบบจัดการไฟล์")
@ -91,7 +91,7 @@ export class SubFolderController extends Controller {
} }
@Put("/{subFolderName}") @Put("/{subFolderName}")
@Tags("SubFolder") @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, "สำเร็จ")
@ -149,7 +149,7 @@ export class SubFolderController extends Controller {
} }
@Delete("/{subFolderName}") @Delete("/{subFolderName}")
@Tags("SubFolder") @Tags("แฟ้มย่อย")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@SuccessResponse(HttpStatusCode.NO_CONTENT, "สำเร็จ") @SuccessResponse(HttpStatusCode.NO_CONTENT, "สำเร็จ")
public async deleteFolder( public async deleteFolder(

View file

@ -33,8 +33,40 @@ if (!DEFAULT_INDEX) throw Error("Default ElasticSearch index must be specified."
"/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/file", "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/file",
) )
export class SubFolderFileController extends Controller { export class SubFolderFileController extends Controller {
@Get("/")
@Tags("ไฟล์")
@Security("bearerAuth")
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
public async getFile(
@Path() cabinetName: string,
@Path() drawerName: string,
@Path() folderName: string,
@Path() subFolderName: string,
): Promise<EhrFile[]> {
const search = await esClient.search<EhrFile & { attachment: Record<string, string> }>({
index: DEFAULT_INDEX!,
query: {
prefix: {
pathname: `${cabinetName}/${drawerName}/${folderName}/${subFolderName}`,
},
},
size: 10000,
});
const records = search.hits.hits
.map((v) => {
if (v._source) {
const { attachment, ...rest } = v._source;
return rest satisfies EhrFile;
}
})
.filter((v: EhrFile | undefined): v is EhrFile => !!v);
return records;
}
@Post("/") @Post("/")
@Tags("SubFolder File") @Tags("ไฟล์")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@Response( @Response(
HttpStatusCode.NOT_FOUND, HttpStatusCode.NOT_FOUND,
@ -115,40 +147,8 @@ export class SubFolderFileController extends Controller {
}; };
} }
@Get("/")
@Tags("SubFolder File")
@Security("bearerAuth")
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
public async getFile(
@Path() cabinetName: string,
@Path() drawerName: string,
@Path() folderName: string,
@Path() subFolderName: string,
): Promise<EhrFile[]> {
const search = await esClient.search<EhrFile & { attachment: Record<string, string> }>({
index: DEFAULT_INDEX!,
query: {
prefix: {
pathname: `${cabinetName}/${drawerName}/${folderName}/${subFolderName}`,
},
},
size: 10000,
});
const records = search.hits.hits
.map((v) => {
if (v._source) {
const { attachment, ...rest } = v._source;
return rest satisfies EhrFile;
}
})
.filter((v: EhrFile | undefined): v is EhrFile => !!v);
return records;
}
@Patch("/{fileName}") @Patch("/{fileName}")
@Tags("SubFolder File") @Tags("ไฟล์")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@Response(HttpStatusCode.NOT_FOUND, "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม") @Response(HttpStatusCode.NOT_FOUND, "ไม่พบตำแหน่งที่ต้องการสร้างแฟ้ม")
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") @SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
@ -248,7 +248,7 @@ export class SubFolderFileController extends Controller {
} }
@Delete("/{fileName}") @Delete("/{fileName}")
@Tags("SubFolder File") @Tags("ไฟล์")
@Security("bearerAuth", ["admin"]) @Security("bearerAuth", ["admin"])
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ") @SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
public async deleteFile( public async deleteFile(
@ -266,7 +266,8 @@ export class SubFolderFileController extends Controller {
} }
@Get("/{fileName}") @Get("/{fileName}")
@Tags("Download") @Tags("ดาวน์โหลด")
@Security("bearerAuth")
@SuccessResponse(HttpStatusCode.OK) @SuccessResponse(HttpStatusCode.OK)
public async downloadFile( public async downloadFile(
@Path() cabinetName: string, @Path() cabinetName: string,

View file

@ -288,6 +288,34 @@ export function RegisterRoutes(app: Router) {
} }
}); });
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file',
authenticateMiddleware([{"bearerAuth":[]}]),
...(fetchMiddlewares<RequestHandler>(FileController)),
...(fetchMiddlewares<RequestHandler>(FileController.prototype.getFile)),
function FileController_getFile(request: any, response: any, next: any) {
const args = {
cabinetName: {"in":"path","name":"cabinetName","required":true,"dataType":"string"},
drawerName: {"in":"path","name":"drawerName","required":true,"dataType":"string"},
folderName: {"in":"path","name":"folderName","required":true,"dataType":"string"},
};
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = getValidatedArgs(args, request, response);
const controller = new FileController();
const promise = controller.getFile.apply(controller, validatedArgs as any);
promiseHandler(controller, promise, response, 200, next);
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.post('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file', app.post('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file',
authenticateMiddleware([{"bearerAuth":["admin"]}]), authenticateMiddleware([{"bearerAuth":["admin"]}]),
...(fetchMiddlewares<RequestHandler>(FileController)), ...(fetchMiddlewares<RequestHandler>(FileController)),
@ -318,34 +346,6 @@ export function RegisterRoutes(app: Router) {
} }
}); });
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file',
authenticateMiddleware([{"bearerAuth":[]}]),
...(fetchMiddlewares<RequestHandler>(FileController)),
...(fetchMiddlewares<RequestHandler>(FileController.prototype.getFile)),
function FileController_getFile(request: any, response: any, next: any) {
const args = {
cabinetName: {"in":"path","name":"cabinetName","required":true,"dataType":"string"},
drawerName: {"in":"path","name":"drawerName","required":true,"dataType":"string"},
folderName: {"in":"path","name":"folderName","required":true,"dataType":"string"},
};
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = getValidatedArgs(args, request, response);
const controller = new FileController();
const promise = controller.getFile.apply(controller, validatedArgs as any);
promiseHandler(controller, promise, response, 200, next);
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.patch('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file/:fileName', app.patch('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/file/:fileName',
authenticateMiddleware([{"bearerAuth":["admin"]}]), authenticateMiddleware([{"bearerAuth":["admin"]}]),
...(fetchMiddlewares<RequestHandler>(FileController)), ...(fetchMiddlewares<RequestHandler>(FileController)),
@ -691,6 +691,35 @@ export function RegisterRoutes(app: Router) {
} }
}); });
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/subfolder/:subFolderName/file',
authenticateMiddleware([{"bearerAuth":[]}]),
...(fetchMiddlewares<RequestHandler>(SubFolderFileController)),
...(fetchMiddlewares<RequestHandler>(SubFolderFileController.prototype.getFile)),
function SubFolderFileController_getFile(request: any, response: any, next: any) {
const args = {
cabinetName: {"in":"path","name":"cabinetName","required":true,"dataType":"string"},
drawerName: {"in":"path","name":"drawerName","required":true,"dataType":"string"},
folderName: {"in":"path","name":"folderName","required":true,"dataType":"string"},
subFolderName: {"in":"path","name":"subFolderName","required":true,"dataType":"string"},
};
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = getValidatedArgs(args, request, response);
const controller = new SubFolderFileController();
const promise = controller.getFile.apply(controller, validatedArgs as any);
promiseHandler(controller, promise, response, 200, next);
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.post('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/subfolder/:subFolderName/file', app.post('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/subfolder/:subFolderName/file',
authenticateMiddleware([{"bearerAuth":["admin"]}]), authenticateMiddleware([{"bearerAuth":["admin"]}]),
...(fetchMiddlewares<RequestHandler>(SubFolderFileController)), ...(fetchMiddlewares<RequestHandler>(SubFolderFileController)),
@ -722,35 +751,6 @@ export function RegisterRoutes(app: Router) {
} }
}); });
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/subfolder/:subFolderName/file',
authenticateMiddleware([{"bearerAuth":[]}]),
...(fetchMiddlewares<RequestHandler>(SubFolderFileController)),
...(fetchMiddlewares<RequestHandler>(SubFolderFileController.prototype.getFile)),
function SubFolderFileController_getFile(request: any, response: any, next: any) {
const args = {
cabinetName: {"in":"path","name":"cabinetName","required":true,"dataType":"string"},
drawerName: {"in":"path","name":"drawerName","required":true,"dataType":"string"},
folderName: {"in":"path","name":"folderName","required":true,"dataType":"string"},
subFolderName: {"in":"path","name":"subFolderName","required":true,"dataType":"string"},
};
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
let validatedArgs: any[] = [];
try {
validatedArgs = getValidatedArgs(args, request, response);
const controller = new SubFolderFileController();
const promise = controller.getFile.apply(controller, validatedArgs as any);
promiseHandler(controller, promise, response, 200, next);
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.patch('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/subfolder/:subFolderName/file/:fileName', app.patch('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/subfolder/:subFolderName/file/:fileName',
authenticateMiddleware([{"bearerAuth":["admin"]}]), authenticateMiddleware([{"bearerAuth":["admin"]}]),
...(fetchMiddlewares<RequestHandler>(SubFolderFileController)), ...(fetchMiddlewares<RequestHandler>(SubFolderFileController)),
@ -814,6 +814,7 @@ export function RegisterRoutes(app: Router) {
}); });
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/subfolder/:subFolderName/file/:fileName', app.get('/cabinet/:cabinetName/drawer/:drawerName/folder/:folderName/subfolder/:subFolderName/file/:fileName',
authenticateMiddleware([{"bearerAuth":[]}]),
...(fetchMiddlewares<RequestHandler>(SubFolderFileController)), ...(fetchMiddlewares<RequestHandler>(SubFolderFileController)),
...(fetchMiddlewares<RequestHandler>(SubFolderFileController.prototype.downloadFile)), ...(fetchMiddlewares<RequestHandler>(SubFolderFileController.prototype.downloadFile)),

View file

@ -214,7 +214,7 @@
} }
}, },
"tags": [ "tags": [
"Cabinet" "ตู้เอกสาร"
], ],
"security": [ "security": [
{ {
@ -234,7 +234,7 @@
} }
}, },
"tags": [ "tags": [
"Cabinet" "ตู้เอกสาร"
], ],
"security": [ "security": [
{ {
@ -276,7 +276,7 @@
} }
}, },
"tags": [ "tags": [
"Cabinet" "ตู้เอกสาร"
], ],
"security": [ "security": [
{ {
@ -325,7 +325,7 @@
} }
}, },
"tags": [ "tags": [
"Cabinet" "ตู้เอกสาร"
], ],
"security": [ "security": [
{ {
@ -368,7 +368,7 @@
} }
}, },
"tags": [ "tags": [
"Drawer" "ลิ้นชัก"
], ],
"security": [ "security": [
{ {
@ -400,7 +400,7 @@
} }
}, },
"tags": [ "tags": [
"Drawer" "ลิ้นชัก"
], ],
"security": [ "security": [
{ {
@ -451,7 +451,7 @@
} }
}, },
"tags": [ "tags": [
"Drawer" "ลิ้นชัก"
], ],
"security": [ "security": [
{ {
@ -505,7 +505,7 @@
} }
}, },
"tags": [ "tags": [
"Drawer" "ลิ้นชัก"
], ],
"security": [ "security": [
{ {
@ -535,6 +535,58 @@
} }
}, },
"/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file": { "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file": {
"get": {
"operationId": "GetFile",
"responses": {
"200": {
"description": "สำเร็จ",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/EhrFile"
},
"type": "array"
}
}
}
}
},
"tags": [
"ไฟล์"
],
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "cabinetName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "drawerName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "folderName",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"post": { "post": {
"operationId": "UploadFile", "operationId": "UploadFile",
"responses": { "responses": {
@ -613,7 +665,7 @@
} }
}, },
"tags": [ "tags": [
"File" "ไฟล์"
], ],
"security": [ "security": [
{ {
@ -682,58 +734,6 @@
} }
} }
} }
},
"get": {
"operationId": "GetFile",
"responses": {
"200": {
"description": "สำเร็จ",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/EhrFile"
},
"type": "array"
}
}
}
}
},
"tags": [
"File"
],
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "cabinetName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "drawerName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "folderName",
"required": true,
"schema": {
"type": "string"
}
}
]
} }
}, },
"/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file/{fileName}": { "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file/{fileName}": {
@ -768,7 +768,7 @@
} }
}, },
"tags": [ "tags": [
"File" "ไฟล์"
], ],
"security": [ "security": [
{ {
@ -847,7 +847,7 @@
} }
}, },
"tags": [ "tags": [
"File" "ไฟล์"
], ],
"security": [ "security": [
{ {
@ -989,7 +989,7 @@
} }
}, },
"tags": [ "tags": [
"Download" "ดาวน์โหลด"
], ],
"security": [ "security": [
{ {
@ -1054,7 +1054,7 @@
} }
}, },
"tags": [ "tags": [
"Folder" "แฟ้ม"
], ],
"security": [ "security": [
{ {
@ -1094,7 +1094,7 @@
} }
}, },
"tags": [ "tags": [
"Folder" "แฟ้ม"
], ],
"security": [ "security": [
{ {
@ -1153,7 +1153,7 @@
} }
}, },
"tags": [ "tags": [
"Folder" "แฟ้ม"
], ],
"security": [ "security": [
{ {
@ -1215,7 +1215,7 @@
} }
}, },
"tags": [ "tags": [
"Folder" "แฟ้ม"
], ],
"security": [ "security": [
{ {
@ -1271,7 +1271,7 @@
} }
}, },
"tags": [ "tags": [
"Search" "ค้นหา"
], ],
"security": [ "security": [
{ {
@ -1313,7 +1313,7 @@
} }
}, },
"tags": [ "tags": [
"SubFolder" "แฟ้มย่อย"
], ],
"security": [ "security": [
{ {
@ -1361,7 +1361,7 @@
} }
}, },
"tags": [ "tags": [
"SubFolder" "แฟ้มย่อย"
], ],
"security": [ "security": [
{ {
@ -1428,7 +1428,7 @@
} }
}, },
"tags": [ "tags": [
"SubFolder" "แฟ้มย่อย"
], ],
"security": [ "security": [
{ {
@ -1498,7 +1498,7 @@
} }
}, },
"tags": [ "tags": [
"SubFolder" "แฟ้มย่อย"
], ],
"security": [ "security": [
{ {
@ -1544,6 +1544,66 @@
} }
}, },
"/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/file": { "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/file": {
"get": {
"operationId": "GetFile",
"responses": {
"200": {
"description": "สำเร็จ",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/EhrFile"
},
"type": "array"
}
}
}
}
},
"tags": [
"ไฟล์"
],
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "cabinetName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "drawerName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "folderName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "subFolderName",
"required": true,
"schema": {
"type": "string"
}
}
]
},
"post": { "post": {
"operationId": "UploadFile", "operationId": "UploadFile",
"responses": { "responses": {
@ -1622,7 +1682,7 @@
} }
}, },
"tags": [ "tags": [
"SubFolder File" "ไฟล์"
], ],
"security": [ "security": [
{ {
@ -1699,66 +1759,6 @@
} }
} }
} }
},
"get": {
"operationId": "GetFile",
"responses": {
"200": {
"description": "สำเร็จ",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/EhrFile"
},
"type": "array"
}
}
}
}
},
"tags": [
"SubFolder File"
],
"security": [
{
"bearerAuth": []
}
],
"parameters": [
{
"in": "path",
"name": "cabinetName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "drawerName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "folderName",
"required": true,
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "subFolderName",
"required": true,
"schema": {
"type": "string"
}
}
]
} }
}, },
"/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/file/{fileName}": { "/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}/file/{fileName}": {
@ -1793,7 +1793,7 @@
} }
}, },
"tags": [ "tags": [
"SubFolder File" "ไฟล์"
], ],
"security": [ "security": [
{ {
@ -1880,7 +1880,7 @@
} }
}, },
"tags": [ "tags": [
"SubFolder File" "ไฟล์"
], ],
"security": [ "security": [
{ {
@ -2030,9 +2030,13 @@
} }
}, },
"tags": [ "tags": [
"Download" "ดาวน์โหลด"
],
"security": [
{
"bearerAuth": []
}
], ],
"security": [],
"parameters": [ "parameters": [
{ {
"in": "path", "in": "path",
@ -2083,5 +2087,28 @@
"url": "/api" "url": "/api"
} }
], ],
"tags": [
{
"name": "ตู้เอกสาร"
},
{
"name": "ลิ้นชัก"
},
{
"name": "แฟ้ม"
},
{
"name": "แฟ้มย่อย"
},
{
"name": "ไฟล์"
},
{
"name": "ดาวน์โหลด"
},
{
"name": "ค้นหา"
}
],
"basePath": "/api" "basePath": "/api"
} }

View file

@ -25,7 +25,16 @@
"description": "Keycloak Bearer Token", "description": "Keycloak Bearer Token",
"in": "header" "in": "header"
} }
} },
"tags": [
{ "name": "ตู้เอกสาร" },
{ "name": "ลิ้นชัก" },
{ "name": "แฟ้ม" },
{ "name": "แฟ้มย่อย" },
{ "name": "ไฟล์" },
{ "name": "ดาวน์โหลด" },
{ "name": "ค้นหา" }
]
}, },
"routes": { "routes": {
"routesDir": "src", "routesDir": "src",