hrms-api-org/src/controllers/MyController.ts

21 lines
561 B
TypeScript
Raw Normal View History

2024-10-29 14:05:52 +07:00
import { profile } from "console";
import { Controller, Get, Post, Query, Route, Security, Tags } from "tsoa";
import { calculateGovAge } from "../interfaces/utils";
import HttpSuccess from "../interfaces/http-success";
2024-01-24 11:39:00 +07:00
@Route("/hello")
2024-01-24 11:56:33 +07:00
@Tags("Test")
2024-01-24 11:39:00 +07:00
@Security("bearerAuth")
export class AppController extends Controller {
@Get()
public async GET() {
return { message: "Hello World 1" };
}
2024-10-29 14:05:52 +07:00
@Post()
public async Post(@Query() profileId: string) {
const result = calculateGovAge(profileId,"OFFICER");
return new HttpSuccess(result);
}
2024-01-24 11:39:00 +07:00
}