entity ย้ายสับเปลี่ยนตำแหน่ง
This commit is contained in:
parent
de27e1941b
commit
dd5662c14a
4 changed files with 292 additions and 1 deletions
50
src/controllers/ChangePositionController.ts
Normal file
50
src/controllers/ChangePositionController.ts
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue