เพิ่ม report controller
This commit is contained in:
parent
0b632803fe
commit
098adb185b
1 changed files with 42 additions and 0 deletions
42
src/controllers/ReportController.ts
Normal file
42
src/controllers/ReportController.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
import {
|
||||||
|
Controller,
|
||||||
|
Get,
|
||||||
|
Post,
|
||||||
|
Put,
|
||||||
|
Delete,
|
||||||
|
Route,
|
||||||
|
Security,
|
||||||
|
Tags,
|
||||||
|
Body,
|
||||||
|
Path,
|
||||||
|
Request,
|
||||||
|
Query,
|
||||||
|
} from "tsoa";
|
||||||
|
import { AppDataSource } from "../database/data-source";
|
||||||
|
import { Brackets, Not } from "typeorm";
|
||||||
|
import HttpSuccess from "../interfaces/http-success";
|
||||||
|
import HttpError from "../interfaces/http-error";
|
||||||
|
import HttpStatusCode from "../interfaces/http-status";
|
||||||
|
@Route("api/v1/kpi/report")
|
||||||
|
@Tags("Report")
|
||||||
|
@Security("bearerAuth")
|
||||||
|
export class ReportController extends Controller {
|
||||||
|
// private developmentScholarshipRepository = AppDataSource.getRepository(DevelopmentScholarship);
|
||||||
|
|
||||||
|
@Get("announcement/{id}")
|
||||||
|
async GetReportAnnouncement(@Path() id: string) {
|
||||||
|
const formattedData = {
|
||||||
|
announceYear: "๒๕๖๔",
|
||||||
|
roundNo: "1",
|
||||||
|
announceDate: "นาย",
|
||||||
|
oc: "พลสิทธิ์",
|
||||||
|
organizationName: "Chief Technology Officer",
|
||||||
|
};
|
||||||
|
|
||||||
|
return new HttpSuccess({
|
||||||
|
template: "announce",
|
||||||
|
reportName: "announce",
|
||||||
|
data: formattedData,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue