51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
|
|
import {
|
||
|
|
Controller,
|
||
|
|
Get,
|
||
|
|
Post,
|
||
|
|
Put,
|
||
|
|
Delete,
|
||
|
|
Patch,
|
||
|
|
Route,
|
||
|
|
Security,
|
||
|
|
Tags,
|
||
|
|
Body,
|
||
|
|
Path,
|
||
|
|
Request,
|
||
|
|
Example,
|
||
|
|
SuccessResponse,
|
||
|
|
Response,
|
||
|
|
Query,
|
||
|
|
} from "tsoa";
|
||
|
|
import { AppDataSource } from "../database/data-source";
|
||
|
|
import HttpSuccess from "../interfaces/http-success";
|
||
|
|
import HttpStatusCode from "../interfaces/http-status";
|
||
|
|
import { Equal, ILike, In, IsNull, Like, Not, Brackets, MoreThan } from "typeorm";
|
||
|
|
import { ChangePosition } from "../entities/ChangePosition";
|
||
|
|
|
||
|
|
@Route("api/v1/placement/change-position")
|
||
|
|
@Tags("Switch")
|
||
|
|
@Security("bearerAuth")
|
||
|
|
@Response(
|
||
|
|
HttpStatusCode.INTERNAL_SERVER_ERROR,
|
||
|
|
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
|
||
|
|
)
|
||
|
|
@SuccessResponse(HttpStatusCode.OK, "สำเร็จ")
|
||
|
|
export class ChangePositionController extends Controller {
|
||
|
|
private ChangePositionRepository = AppDataSource.getRepository(ChangePosition);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* API รายการออกคำสั่งย้ายสับเปลี่ยนตำแหน่ง
|
||
|
|
*
|
||
|
|
* @summary API รายการออกคำสั่งย้ายสับเปลี่ยนตำแหน่ง
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
@Get("")
|
||
|
|
async GetChangePositionLists() {
|
||
|
|
|
||
|
|
const data = await this.ChangePositionRepository.find();
|
||
|
|
return new HttpSuccess(data);
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|