-
-
- {siteId && (
- <>
-
-
-
-
-
-
-
- >
- )}
-
-
-
-
+
+
+
+ {siteId && (
+ <>
+
+
+
+
+
+
+
+ >
+ )}
-
- >
+
+
+
+
);
}
diff --git a/apps/cs/src/pages/menu/ui/type-menu-form.tsx b/apps/cs/src/pages/menu/ui/type-menu-form.tsx
index 210c36f17..07b7ca4fe 100644
--- a/apps/cs/src/pages/menu/ui/type-menu-form.tsx
+++ b/apps/cs/src/pages/menu/ui/type-menu-form.tsx
@@ -15,7 +15,7 @@ import {
} from "@common/components";
import { FormItem, FormControl, FormField } from "@/shared/ui/form";
import type { BoardPopup } from "@/entities/board";
-import type { Content } from "../model/content-interface";
+import type { Contents } from "@/entities/contents";
import type { User } from "../model/organization-interface";
import type { MenuFormData, MenuType } from "../model/menu-interface";
import { OrganizationSearchDialog } from "./organization-search-dialog";
@@ -32,7 +32,7 @@ function TypeMenuForm({ form, menuType }: TypeMenuFormProps) {
form.setValue("iconNm", icon);
};
- const handleContentSelect = (content: Content) => {
+ const handleContentSelect = (content: Contents) => {
form.setValue("menuLnkgSn", content.contsSn);
form.setValue("menuLnkgSnNm", content.contsTtl);
};
diff --git a/apps/cs/src/pages/module/api/authorization-service.ts b/apps/cs/src/pages/module/api/authorization-service.ts
new file mode 100644
index 000000000..d68c6920a
--- /dev/null
+++ b/apps/cs/src/pages/module/api/authorization-service.ts
@@ -0,0 +1,53 @@
+import { client } from "@/shared/api";
+import { ENDPOINT } from "@/shared/config";
+import type {
+ AuthorizationsService,
+ AuthorizationsParams,
+ AuthorizationsList,
+ AuthorizationFormData,
+ WithRoleAuthorizations,
+} from "../model/authorizations-interface";
+
+export class AuthorizationsApiService implements AuthorizationsService {
+ public async getAuthorizationsList(
+ params: AuthorizationsParams,
+ ): Promise
{
+ const response = await client.get(
+ `${ENDPOINT.USER_SERVICE.AUTHORIZATIONS}`,
+ { params },
+ );
+ return response.data;
+ }
+
+ public async getAuthorizationInfo(
+ authorizationNo: string,
+ ): Promise {
+ const response = await client.get(
+ `${ENDPOINT.USER_SERVICE.AUTHORIZATIONS}/${authorizationNo}`,
+ );
+ return response.data;
+ }
+
+ public async createAuthorization(
+ data: AuthorizationFormData,
+ ): Promise {
+ const response = await client.post(
+ `${ENDPOINT.USER_SERVICE.AUTHORIZATIONS}`,
+ data,
+ );
+ return response.data;
+ }
+
+ public async updateAuthorization(
+ authorizationNo: string,
+ data: AuthorizationFormData,
+ ): Promise {
+ const response = await client.put(
+ `${ENDPOINT.USER_SERVICE.AUTHORIZATIONS}/${authorizationNo}`,
+ data,
+ );
+ return response.data;
+ }
+}
+
+export const AuthorizationsApi = new AuthorizationsApiService();
diff --git a/apps/cs/src/pages/module/api/role-authorization-service.ts b/apps/cs/src/pages/module/api/role-authorization-service.ts
new file mode 100644
index 000000000..92f2c8eb9
--- /dev/null
+++ b/apps/cs/src/pages/module/api/role-authorization-service.ts
@@ -0,0 +1,43 @@
+import { client } from "@/shared/api";
+import { ENDPOINT } from "@/shared/config";
+import type {
+ RoleAuthorizationsService,
+ RoleAuthorizationsParams,
+ RoleAuthorizationsList,
+ RoleAuthorizationsData,
+ RoleAuthorizations,
+} from "../model/role-authorizations-interface";
+
+export class RoleAuthorizationsApiService implements RoleAuthorizationsService {
+ public async getRoleAuthorizationsList(
+ params: RoleAuthorizationsParams,
+ ): Promise {
+ const response = await client.get(
+ `${ENDPOINT.USER_SERVICE.ROLE_AUTHORIZATIONS}/api`,
+ { params },
+ );
+ return response.data;
+ }
+
+ public async createRoleAuthorizations(
+ data: RoleAuthorizationsData,
+ ): Promise {
+ const response = await client.post(
+ `${ENDPOINT.USER_SERVICE.ROLE_AUTHORIZATIONS}`,
+ data,
+ );
+ return response.data;
+ }
+
+ public async updateRoleAuthorizations(
+ data: RoleAuthorizationsData,
+ ): Promise {
+ const response = await client.put(
+ `${ENDPOINT.USER_SERVICE.ROLE_AUTHORIZATIONS}`,
+ data,
+ );
+ return response.data;
+ }
+}
+
+export const RoleAuthorizationsApi = new RoleAuthorizationsApiService();
diff --git a/apps/cs/src/pages/module/index.ts b/apps/cs/src/pages/module/index.ts
new file mode 100644
index 000000000..fffbd617b
--- /dev/null
+++ b/apps/cs/src/pages/module/index.ts
@@ -0,0 +1,3 @@
+export { ModulePage } from "./ui/module-page";
+export { CreatePage } from "./ui/create-page";
+export { ModifyPage } from "./ui/modify-page";
diff --git a/apps/cs/src/pages/module/model/authorizations-interface.ts b/apps/cs/src/pages/module/model/authorizations-interface.ts
new file mode 100644
index 000000000..e34d150e0
--- /dev/null
+++ b/apps/cs/src/pages/module/model/authorizations-interface.ts
@@ -0,0 +1,62 @@
+import { z } from "zod";
+import type { PageableList, PageableParams } from "@/shared/model";
+
+export interface AuthorizationsParams extends PageableParams {
+ keywordType?: string;
+ keyword?: string;
+ authorizationName?: string;
+ httpMethodCode?: string;
+ useYn?: string;
+}
+
+export interface Authorizations {
+ authorizationNo: number;
+ authorizationName: string;
+ urlPatternValue: string;
+ httpMethodCode: string;
+ sortSeq: number;
+ useYn: string;
+ mdfr: string;
+ mdfcnDt: string;
+}
+
+export interface RoleAuthorizations {
+ roleId: string;
+ authorizationNo: number;
+ authorizationName: string;
+ urlPatternValue: string;
+ httpMethodCode: string;
+ sortSeq: number;
+ createdAt: string;
+}
+
+export interface WithRoleAuthorizations extends Authorizations {
+ roleAuthorizations: RoleAuthorizations[];
+}
+
+export const authorizationFormSchema = z.object({
+ authorizationName: z.string(),
+ urlPatternValue: z.string(),
+ httpMethodCode: z.string(),
+ sortSeq: z.number(),
+ useYn: z.string(),
+});
+
+export type AuthorizationsList = PageableList;
+export type AuthorizationFormData = z.infer;
+
+export interface AuthorizationsService {
+ getAuthorizationsList: (
+ params: AuthorizationsParams,
+ ) => Promise;
+ getAuthorizationInfo: (
+ authorizationNo: string,
+ ) => Promise;
+ createAuthorization: (
+ data: AuthorizationFormData,
+ ) => Promise;
+ updateAuthorization: (
+ authorizationNo: string,
+ data: AuthorizationFormData,
+ ) => Promise;
+}
diff --git a/apps/cs/src/pages/module/model/authorizations-table-columns.tsx b/apps/cs/src/pages/module/model/authorizations-table-columns.tsx
new file mode 100644
index 000000000..a2ccb2a88
--- /dev/null
+++ b/apps/cs/src/pages/module/model/authorizations-table-columns.tsx
@@ -0,0 +1,58 @@
+import dayjs from "dayjs";
+import { type ColumnDef } from "@tanstack/react-table";
+import type { Authorizations } from "./authorizations-interface";
+import { ManagementAuthorityDialog } from "../ui/management-authority-dialog";
+
+export const columns: ColumnDef[] = [
+ {
+ id: "no",
+ header: "NO",
+ cell: ({ row }) => row.index + 1,
+ },
+ {
+ accessorKey: "authorizationName",
+ header: "API명",
+ },
+ {
+ accessorKey: "urlPatternValue",
+ header: "API URL",
+ },
+ {
+ accessorKey: "httpMethodCode",
+ header: "요청 메소드",
+ },
+ {
+ accessorKey: "useYn",
+ header: "사용여부",
+ },
+ {
+ accessorKey: "mdfr",
+ header: "최종수정자",
+ },
+ {
+ accessorKey: "mdfcnDt",
+ header: "최종수정일",
+ cell: ({ row }) => {
+ const date = dayjs(row.original.mdfcnDt);
+ return date.format("YYYY-MM-DD");
+ },
+ },
+ {
+ id: "action",
+ header: "권한관리",
+ cell: ({ row }) => {
+ return (
+ {
+ e.stopPropagation();
+ }}
+ >
+
+
+ );
+ },
+ },
+];
diff --git a/apps/cs/src/pages/module/model/role-authorizations-interface.ts b/apps/cs/src/pages/module/model/role-authorizations-interface.ts
new file mode 100644
index 000000000..a2352346e
--- /dev/null
+++ b/apps/cs/src/pages/module/model/role-authorizations-interface.ts
@@ -0,0 +1,45 @@
+import { z } from "zod";
+import type { PageableList, PageableParams } from "@/shared/model";
+
+export interface RoleAuthorizationsParams extends PageableParams {
+ keywordType?: string;
+ keyword?: string;
+ authorizationNo?: string;
+}
+
+export interface RoleAuthorizations {
+ roleId: string;
+ roleName: string;
+ roleContent: string;
+ useYn: string;
+ authorizationNo: number;
+ authYn: string;
+}
+
+export const roleAuthorizationsSchema = z.object({
+ roleId: z.string(),
+ authorizationNo: z.number(),
+ authYn: z.string(),
+});
+
+export const roleAuthorizationsFormSchema = z.object({
+ roleAuthorizations: z.array(roleAuthorizationsSchema),
+});
+
+export type RoleAuthorizationsList = PageableList;
+export type RoleAuthorizationsData = z.infer[];
+export type RoleAuthorizationsFormData = z.infer<
+ typeof roleAuthorizationsFormSchema
+>;
+
+export interface RoleAuthorizationsService {
+ getRoleAuthorizationsList: (
+ params: RoleAuthorizationsParams,
+ ) => Promise;
+ createRoleAuthorizations: (
+ data: RoleAuthorizationsData,
+ ) => Promise;
+ updateRoleAuthorizations: (
+ data: RoleAuthorizationsData,
+ ) => Promise;
+}
diff --git a/apps/cs/src/pages/module/model/role-authorizations-table-columns.tsx b/apps/cs/src/pages/module/model/role-authorizations-table-columns.tsx
new file mode 100644
index 000000000..e9a9a6d4d
--- /dev/null
+++ b/apps/cs/src/pages/module/model/role-authorizations-table-columns.tsx
@@ -0,0 +1,53 @@
+import { type ColumnDef } from "@tanstack/react-table";
+import type { RoleAuthorizations } from "./role-authorizations-interface";
+import { Checkbox } from "@common/components/ui";
+import type { UseFormReturn } from "react-hook-form";
+import type { RoleAuthorizationsFormData } from "./role-authorizations-interface";
+
+export const createColumns = (
+ form: UseFormReturn,
+): ColumnDef[] => [
+ {
+ id: "select",
+ header: ({ table }) => (
+