From b5fb9d3408a8cd59ce33ec5f8ed57724f0750cdd Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Fri, 5 Apr 2024 11:30:18 +0700 Subject: [PATCH] chore: restructure --- ...tact-controller.ts => branch-contact-controller.ts} | 10 +++++----- src/controllers/{branch => }/branch-controller.ts | 8 ++++---- .../user-controller.ts => branch-user-controller.ts} | 8 ++++---- .../user-controller.ts => keycloak-controller.ts} | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) rename src/controllers/{branch/contact-controller.ts => branch-contact-controller.ts} (94%) rename src/controllers/{branch => }/branch-controller.ts (97%) rename src/controllers/{branch/user-controller.ts => branch-user-controller.ts} (96%) rename src/controllers/{keycloak/user-controller.ts => keycloak-controller.ts} (98%) diff --git a/src/controllers/branch/contact-controller.ts b/src/controllers/branch-contact-controller.ts similarity index 94% rename from src/controllers/branch/contact-controller.ts rename to src/controllers/branch-contact-controller.ts index 65b4398..7a9b3b7 100644 --- a/src/controllers/branch/contact-controller.ts +++ b/src/controllers/branch-contact-controller.ts @@ -13,11 +13,11 @@ import { Tags, } from "tsoa"; -import prisma from "../../db"; -import minio from "../../services/minio"; -import HttpError from "../../interfaces/http-error"; -import HttpStatus from "../../interfaces/http-status"; -import { RequestWithUser } from "../../interfaces/user"; +import prisma from "../db"; +import minio from "../services/minio"; +import HttpError from "../interfaces/http-error"; +import HttpStatus from "../interfaces/http-status"; +import { RequestWithUser } from "../interfaces/user"; if (!process.env.MINIO_BUCKET) { throw Error("Require MinIO bucket."); diff --git a/src/controllers/branch/branch-controller.ts b/src/controllers/branch-controller.ts similarity index 97% rename from src/controllers/branch/branch-controller.ts rename to src/controllers/branch-controller.ts index 8d30d10..0c2c777 100644 --- a/src/controllers/branch/branch-controller.ts +++ b/src/controllers/branch-controller.ts @@ -14,10 +14,10 @@ import { Tags, } from "tsoa"; -import prisma from "../../db"; -import HttpError from "../../interfaces/http-error"; -import HttpStatus from "../../interfaces/http-status"; -import { RequestWithUser } from "../../interfaces/user"; +import prisma from "../db"; +import HttpError from "../interfaces/http-error"; +import HttpStatus from "../interfaces/http-status"; +import { RequestWithUser } from "../interfaces/user"; type BranchCreate = { code?: string; diff --git a/src/controllers/branch/user-controller.ts b/src/controllers/branch-user-controller.ts similarity index 96% rename from src/controllers/branch/user-controller.ts rename to src/controllers/branch-user-controller.ts index 5c766fc..5987661 100644 --- a/src/controllers/branch/user-controller.ts +++ b/src/controllers/branch-user-controller.ts @@ -13,10 +13,10 @@ import { Tags, } from "tsoa"; -import prisma from "../../db"; -import HttpError from "../../interfaces/http-error"; -import HttpStatus from "../../interfaces/http-status"; -import { RequestWithUser } from "../../interfaces/user"; +import prisma from "../db"; +import HttpError from "../interfaces/http-error"; +import HttpStatus from "../interfaces/http-status"; +import { RequestWithUser } from "../interfaces/user"; type BranchUserBody = { user: string[] }; diff --git a/src/controllers/keycloak/user-controller.ts b/src/controllers/keycloak-controller.ts similarity index 98% rename from src/controllers/keycloak/user-controller.ts rename to src/controllers/keycloak-controller.ts index 086efe6..209b943 100644 --- a/src/controllers/keycloak/user-controller.ts +++ b/src/controllers/keycloak-controller.ts @@ -1,5 +1,5 @@ import { Body, Controller, Delete, Get, Path, Post, Route, Security, Tags } from "tsoa"; -import { addUserRoles, createUser, getRoles, removeUserRoles } from "../../services/keycloak"; +import { addUserRoles, createUser, getRoles, removeUserRoles } from "../services/keycloak"; @Route("api/keycloak") @Tags("Keycloak")