From f181a19fdf8b0e3cbfed5778420a8d624c14444e Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 15 Feb 2024 18:06:39 +0700 Subject: [PATCH 1/2] =?UTF-8?q?API=20=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=A5?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=AD=E0=B8=B5=E0=B8=A2=E0=B8=94=E0=B8=9C?= =?UTF-8?q?=E0=B8=B1=E0=B8=87=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/SalaryController.ts | 43 ++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/controllers/SalaryController.ts b/src/controllers/SalaryController.ts index 9c72317..6d44f17 100644 --- a/src/controllers/SalaryController.ts +++ b/src/controllers/SalaryController.ts @@ -41,8 +41,8 @@ export class Salary extends Controller { @Example( { salaryType: "string", //*ประเภทผัง (OFFICER->"ข้าราชการกรุงเทพมหานครสามัญ",EMPLOYEE->"ลูกจ้างประจำกรุงเทพมหานคร") - posType: "string", //*ระดับของตำแหน่ง - posLevel: "string", //*ประเภทของตำแหน่ง + posTypeId: "string(Guid)", //*ระดับของตำแหน่ง + posLevelId: "string(Guid)", //*ประเภทของตำแหน่ง isActive: "boolean", //*สถานะการใช้งาน date: "datetime", //ให้ไว้ ณ วันที่ startDate: "datetime", //วันที่มีผลบังคับใช้ @@ -113,8 +113,8 @@ export class Salary extends Controller { @Example( { salaryType: "string", //*ประเภทผัง (OFFICER->"ข้าราชการกรุงเทพมหานครสามัญ",EMPLOYEE->"ลูกจ้างประจำกรุงเทพมหานคร") - posType: "string", //*ระดับของตำแหน่ง - posLevel: "string", //*ประเภทของตำแหน่ง + posTypeId: "string(Guid)", //*ระดับของตำแหน่ง + posLevelId: "string(Guid)", //*ประเภทของตำแหน่ง isActive: "boolean", //*สถานะการใช้งาน date: "datetime", //ให้ไว้ ณ วันที่ startDate: "datetime", //วันที่มีผลบังคับใช้ @@ -215,6 +215,41 @@ export class Salary extends Controller { } } + /** + * API รายละเอียดผังเงินเดือน + * + * @summary SLR_004 - รายละเอียดผังเงินเดือน #4 + * + * @param {string} id Guid, *Id ผังเงินเดือน + */ + @Get("{id}") + @Example( + { + salaryType: "string", //*ประเภทผัง (OFFICER->"ข้าราชการกรุงเทพมหานครสามัญ",EMPLOYEE->"ลูกจ้างประจำกรุงเทพมหานคร") + posTypeId: "string(Guid)", //*ระดับของตำแหน่ง + posLevelId: "string(Guid)", //*ประเภทของตำแหน่ง + isActive: "boolean", //*สถานะการใช้งาน + date: "datetime", //ให้ไว้ ณ วันที่ + startDate: "datetime", //วันที่มีผลบังคับใช้ + endDate: "datetime", //วันที่สิ้นสุดบังคับใช้ + detail: "string", //คำอธิบาย + }, + ) + async GetSalaryById(@Path() id: string) { + try { + const salary = await this.salaryRepository.findOne({ + where: { id: id }, + select: ["salaryType", "posTypeId", "posLevelId", "isActive", "date", "startDate", "endDate", "details"] + }); + if (!salary) { + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลไอดี: "+ id); + } + return new HttpSuccess(salary); + } catch (error) { + return error; + } + } + } From 8e8c5fa8ebebb599b8e16fed41abc8f0732c2075 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Thu, 15 Feb 2024 18:09:03 +0700 Subject: [PATCH 2/2] no message --- .github/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index caca4d3..ba003b6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,7 @@ env: REGISTRY: docker.frappet.com IMAGE_NAME: ehr/bma-ehr-salary-service DEPLOY_HOST: 49.0.91.80 - COMPOSE_PATH: /home/frappet/docker/bma-ehr-salary + COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-salary jobs: # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd release-test: @@ -62,8 +62,8 @@ jobs: port: 10102 script: | cd "${{env.COMPOSE_PATH}}" - docker-compose pull - docker-compose up -d + docker compose pull + docker compose up -d echo "${{ steps.gen_ver.outputs.image_ver }}"> success - uses: snow-actions/line-notify@v1.1.0 if: success()