refactor: route decorators
This commit is contained in:
parent
1ec2b69f87
commit
6bf28d11a8
3 changed files with 15 additions and 15 deletions
|
|
@ -20,9 +20,9 @@ import { pathExist } from "../utils/minio";
|
||||||
import HttpError from "../interfaces/http-error";
|
import HttpError from "../interfaces/http-error";
|
||||||
import { EhrFile } from "../interfaces/ehr-fs";
|
import { EhrFile } from "../interfaces/ehr-fs";
|
||||||
|
|
||||||
@Route("/cabinet")
|
@Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file")
|
||||||
export class FileController extends Controller {
|
export class FileController extends Controller {
|
||||||
@Post("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file")
|
@Post("/")
|
||||||
@Tags("File")
|
@Tags("File")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.CREATED)
|
@SuccessResponse(HttpStatusCode.CREATED)
|
||||||
|
|
@ -111,7 +111,7 @@ export class FileController extends Controller {
|
||||||
return this.setStatus(HttpStatusCode.CREATED);
|
return this.setStatus(HttpStatusCode.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file")
|
@Get("/")
|
||||||
@Tags("File")
|
@Tags("File")
|
||||||
@SuccessResponse(HttpStatusCode.OK)
|
@SuccessResponse(HttpStatusCode.OK)
|
||||||
public async getFile(
|
public async getFile(
|
||||||
|
|
@ -146,7 +146,7 @@ export class FileController extends Controller {
|
||||||
return records;
|
return records;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Patch("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file/{fileName}")
|
@Patch("/{fileName}")
|
||||||
@Tags("File")
|
@Tags("File")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.OK)
|
@SuccessResponse(HttpStatusCode.OK)
|
||||||
|
|
@ -238,7 +238,7 @@ export class FileController extends Controller {
|
||||||
return this.setStatus(HttpStatusCode.NO_CONTENT);
|
return this.setStatus(HttpStatusCode.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/file/{fileName}")
|
@Delete("/{fileName}")
|
||||||
@Tags("File")
|
@Tags("File")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.OK)
|
@SuccessResponse(HttpStatusCode.OK)
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ import { listFolder, pathExist } from "../utils/minio";
|
||||||
import { EhrFolder } from "../interfaces/ehr-fs";
|
import { EhrFolder } from "../interfaces/ehr-fs";
|
||||||
import minioClient from "../storage";
|
import minioClient from "../storage";
|
||||||
|
|
||||||
@Route("/cabinet")
|
@Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder")
|
||||||
export class FolderController extends Controller {
|
export class FolderController extends Controller {
|
||||||
@Get("/{cabinetName}/drawer/{drawerName}/folder")
|
@Get("/")
|
||||||
@Tags("Folder")
|
@Tags("Folder")
|
||||||
@SuccessResponse(HttpStatusCode.OK)
|
@SuccessResponse(HttpStatusCode.OK)
|
||||||
public async listFolder(
|
public async listFolder(
|
||||||
|
|
@ -39,7 +39,7 @@ export class FolderController extends Controller {
|
||||||
return listFolder(fullpath);
|
return listFolder(fullpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post("/{cabinetName}/drawer/{drawerName}/folder")
|
@Post("/")
|
||||||
@Tags("Folder")
|
@Tags("Folder")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.CREATED)
|
@SuccessResponse(HttpStatusCode.CREATED)
|
||||||
|
|
@ -67,7 +67,7 @@ export class FolderController extends Controller {
|
||||||
return this.setStatus(HttpStatusCode.CREATED);
|
return this.setStatus(HttpStatusCode.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put("/{cabinetName}/drawer/{drawerName}/folder/{folderName}")
|
@Put("/{folderName}")
|
||||||
@Tags("Folder")
|
@Tags("Folder")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.NO_CONTENT)
|
@SuccessResponse(HttpStatusCode.NO_CONTENT)
|
||||||
|
|
@ -113,7 +113,7 @@ export class FolderController extends Controller {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete("/{cabinetName}/drawer/{drawerName}/folder/{folderName}")
|
@Delete("/{folderName}")
|
||||||
@Tags("Folder")
|
@Tags("Folder")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.NO_CONTENT)
|
@SuccessResponse(HttpStatusCode.NO_CONTENT)
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@ import { listFolder, pathExist } from "../utils/minio";
|
||||||
import { EhrFolder } from "../interfaces/ehr-fs";
|
import { EhrFolder } from "../interfaces/ehr-fs";
|
||||||
import minioClient from "../storage";
|
import minioClient from "../storage";
|
||||||
|
|
||||||
@Route("/cabinet")
|
@Route("/cabinet/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder")
|
||||||
export class SubFolderController extends Controller {
|
export class SubFolderController extends Controller {
|
||||||
@Get("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder")
|
@Get("/")
|
||||||
@Tags("SubFolder")
|
@Tags("SubFolder")
|
||||||
@SuccessResponse(HttpStatusCode.OK)
|
@SuccessResponse(HttpStatusCode.OK)
|
||||||
public async listFolder(
|
public async listFolder(
|
||||||
|
|
@ -40,7 +40,7 @@ export class SubFolderController extends Controller {
|
||||||
return listFolder(fullpath);
|
return listFolder(fullpath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder")
|
@Post("/")
|
||||||
@Tags("SubFolder")
|
@Tags("SubFolder")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.CREATED)
|
@SuccessResponse(HttpStatusCode.CREATED)
|
||||||
|
|
@ -72,7 +72,7 @@ export class SubFolderController extends Controller {
|
||||||
return this.setStatus(HttpStatusCode.CREATED);
|
return this.setStatus(HttpStatusCode.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}")
|
@Put("/{subFolderName}")
|
||||||
@Tags("SubFolder")
|
@Tags("SubFolder")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.NO_CONTENT)
|
@SuccessResponse(HttpStatusCode.NO_CONTENT)
|
||||||
|
|
@ -119,7 +119,7 @@ export class SubFolderController extends Controller {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete("/{cabinetName}/drawer/{drawerName}/folder/{folderName}/subfolder/{subFolderName}")
|
@Delete("/{subFolderName}")
|
||||||
@Tags("SubFolder")
|
@Tags("SubFolder")
|
||||||
@Security("bearerAuth")
|
@Security("bearerAuth")
|
||||||
@SuccessResponse(HttpStatusCode.NO_CONTENT)
|
@SuccessResponse(HttpStatusCode.NO_CONTENT)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue