chore: update endpoints tag
This commit is contained in:
parent
96b18f1049
commit
fdf3a42659
1 changed files with 20 additions and 1 deletions
|
|
@ -545,7 +545,6 @@ export class EmployeeController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Route("api/v1/employee/{employeeId}")
|
@Route("api/v1/employee/{employeeId}")
|
||||||
@Tags("Employee")
|
|
||||||
export class EmployeeFileController extends Controller {
|
export class EmployeeFileController extends Controller {
|
||||||
private async checkPermission(user: RequestWithUser["user"], id: string) {
|
private async checkPermission(user: RequestWithUser["user"], id: string) {
|
||||||
const data = await prisma.employee.findFirst({
|
const data = await prisma.employee.findFirst({
|
||||||
|
|
@ -570,12 +569,14 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("image")
|
@Get("image")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee")
|
||||||
async listImage(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
async listImage(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
||||||
await this.checkPermission(req.user, employeeId);
|
await this.checkPermission(req.user, employeeId);
|
||||||
return await listFile(fileLocation.employee.img(employeeId));
|
return await listFile(fileLocation.employee.img(employeeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get("image/{name}")
|
@Get("image/{name}")
|
||||||
|
@Tags("Employee")
|
||||||
async getImage(
|
async getImage(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -586,6 +587,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Put("image/{name}")
|
@Put("image/{name}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee")
|
||||||
async putImage(
|
async putImage(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -600,6 +602,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Delete("image/{name}")
|
@Delete("image/{name}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee")
|
||||||
async delImage(
|
async delImage(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -611,6 +614,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("attachment")
|
@Get("attachment")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee")
|
||||||
async listAttachment(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
async listAttachment(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
||||||
await this.checkPermission(req.user, employeeId);
|
await this.checkPermission(req.user, employeeId);
|
||||||
return await listFile(fileLocation.employee.attachment(employeeId));
|
return await listFile(fileLocation.employee.attachment(employeeId));
|
||||||
|
|
@ -618,12 +622,14 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("attachment/{name}")
|
@Get("attachment/{name}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee")
|
||||||
async getAttachment(@Path() employeeId: string, @Path() name: string) {
|
async getAttachment(@Path() employeeId: string, @Path() name: string) {
|
||||||
return await getFile(fileLocation.employee.attachment(employeeId, name));
|
return await getFile(fileLocation.employee.attachment(employeeId, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put("attachment/{name}")
|
@Put("attachment/{name}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee")
|
||||||
async putAttachment(
|
async putAttachment(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -635,6 +641,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Delete("attachment/{name}")
|
@Delete("attachment/{name}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee")
|
||||||
async delAttachment(
|
async delAttachment(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -646,6 +653,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("file-passport")
|
@Get("file-passport")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee Passport")
|
||||||
async listPassport(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
async listPassport(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
||||||
await this.checkPermission(req.user, employeeId);
|
await this.checkPermission(req.user, employeeId);
|
||||||
return await listFile(fileLocation.employee.passport(employeeId));
|
return await listFile(fileLocation.employee.passport(employeeId));
|
||||||
|
|
@ -653,12 +661,14 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("file-passport/{passportId}")
|
@Get("file-passport/{passportId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee Passport")
|
||||||
async getPassport(@Path() employeeId: string, @Path() passportId: string) {
|
async getPassport(@Path() employeeId: string, @Path() passportId: string) {
|
||||||
return await getFile(fileLocation.employee.passport(employeeId, passportId));
|
return await getFile(fileLocation.employee.passport(employeeId, passportId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put("file-passport/{passportId}")
|
@Put("file-passport/{passportId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee Passport")
|
||||||
async putPassport(
|
async putPassport(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -670,6 +680,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Delete("file-passport/{passportId}")
|
@Delete("file-passport/{passportId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee Passport")
|
||||||
async delPassport(
|
async delPassport(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -681,6 +692,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("file-visa")
|
@Get("file-visa")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee Visa")
|
||||||
async listVisa(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
async listVisa(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
||||||
await this.checkPermission(req.user, employeeId);
|
await this.checkPermission(req.user, employeeId);
|
||||||
return await listFile(fileLocation.employee.visa(employeeId));
|
return await listFile(fileLocation.employee.visa(employeeId));
|
||||||
|
|
@ -688,12 +700,14 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("file-visa/{visaId}")
|
@Get("file-visa/{visaId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee Visa")
|
||||||
async getVisa(@Path() employeeId: string, @Path() visaId: string) {
|
async getVisa(@Path() employeeId: string, @Path() visaId: string) {
|
||||||
return await getFile(fileLocation.employee.visa(employeeId, visaId));
|
return await getFile(fileLocation.employee.visa(employeeId, visaId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put("file-visa/{visaId}")
|
@Put("file-visa/{visaId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee Visa")
|
||||||
async putVisa(
|
async putVisa(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -705,6 +719,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Delete("file-visa/{visaId}")
|
@Delete("file-visa/{visaId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee Visa")
|
||||||
async delVisa(
|
async delVisa(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -716,6 +731,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("file-in-country-notice")
|
@Get("file-in-country-notice")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee In Country Notice")
|
||||||
async listNotice(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
async listNotice(@Request() req: RequestWithUser, @Path() employeeId: string) {
|
||||||
await this.checkPermission(req.user, employeeId);
|
await this.checkPermission(req.user, employeeId);
|
||||||
return await listFile(fileLocation.employee.inCountryNotice(employeeId));
|
return await listFile(fileLocation.employee.inCountryNotice(employeeId));
|
||||||
|
|
@ -723,12 +739,14 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Get("file-in-country-notice/{noticeId}")
|
@Get("file-in-country-notice/{noticeId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee In Country Notice")
|
||||||
async getNotice(@Path() employeeId: string, @Path() noticeId: string) {
|
async getNotice(@Path() employeeId: string, @Path() noticeId: string) {
|
||||||
return await getFile(fileLocation.employee.inCountryNotice(employeeId, noticeId));
|
return await getFile(fileLocation.employee.inCountryNotice(employeeId, noticeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Put("file-in-country-notice/{noticeId}")
|
@Put("file-in-country-notice/{noticeId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee In Country Notice")
|
||||||
async putNotice(
|
async putNotice(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
@ -742,6 +760,7 @@ export class EmployeeFileController extends Controller {
|
||||||
|
|
||||||
@Delete("file-in-country-notice/{noticeId}")
|
@Delete("file-in-country-notice/{noticeId}")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
|
@Tags("Employee In Country Notice")
|
||||||
async delNotice(
|
async delNotice(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
@Path() employeeId: string,
|
@Path() employeeId: string,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue