diff --git a/apps/cs/app/(with-base-layout)/template/page.tsx b/apps/cs/app/(with-base-layout)/template/page.tsx new file mode 100644 index 000000000..f5eab5953 --- /dev/null +++ b/apps/cs/app/(with-base-layout)/template/page.tsx @@ -0,0 +1,2 @@ +import { TemplatePage } from "@/pages/template"; +export default TemplatePage; diff --git a/apps/cs/src/pages/menu/model/board-table-columns.tsx b/apps/cs/src/pages/menu/model/board-table-columns.tsx index f144ac158..4cdf29498 100644 --- a/apps/cs/src/pages/menu/model/board-table-columns.tsx +++ b/apps/cs/src/pages/menu/model/board-table-columns.tsx @@ -1,31 +1,30 @@ -import { createColumnHelper } from "@tanstack/react-table"; +import type { ColumnDef } from "@tanstack/react-table"; import { Checkbox } from "@common/components/ui"; import type { BoardPopup } from "@/entities/board"; -const columnHelper = createColumnHelper(); - -const columns = [ - columnHelper.accessor((_, index) => index + 1, { +export const columns: ColumnDef[] = [ + { id: "no", header: "NO", - }), - columnHelper.accessor("bbsNm", { - id: "bbsNm", + cell: ({ row }) => row.index + 1, + }, + { + accessorKey: "bbsNm", header: "게시판명", - }), - columnHelper.accessor("bbsTypeNm", { - id: "bbsTypeNm", + }, + { + accessorKey: "bbsTypeNm", header: "게시판유형", - }), - columnHelper.accessor("regDt", { - id: "regDt", + }, + { + accessorKey: "regDt", header: "최초생성일", - }), - columnHelper.accessor("pstCnt", { - id: "pstCnt", + }, + { + accessorKey: "pstCnt", header: "게시물건수", - }), - columnHelper.display({ + }, + { id: "select", header: "선택", cell: ({ row }) => { @@ -37,7 +36,5 @@ const columns = [ /> ); }, - }), + }, ]; - -export { columns }; diff --git a/apps/cs/src/pages/site/model/table-columns.tsx b/apps/cs/src/pages/site/model/table-columns.tsx index 8a2d852cd..c5da01880 100644 --- a/apps/cs/src/pages/site/model/table-columns.tsx +++ b/apps/cs/src/pages/site/model/table-columns.tsx @@ -1,48 +1,43 @@ import dayjs from "dayjs"; -import { createColumnHelper } from "@tanstack/react-table"; +import { type ColumnDef } from "@tanstack/react-table"; import type { Site } from "@/entities/site"; -const columnHelper = createColumnHelper(); - -const columns = [ - columnHelper.accessor((_, index) => index + 1, { +export const columns: ColumnDef[] = [ + { id: "no", header: "NO", - }), - columnHelper.accessor("siteId", { - id: "siteId", + cell: ({ row }) => row.index + 1, + }, + { + accessorKey: "siteId", header: "사이트코드", - }), - columnHelper.accessor("siteNm", { - id: "siteNm", + }, + { + accessorKey: "siteNm", header: "사이트명", - }), - columnHelper.accessor("dmnAddr", { - id: "dmnAddr", + }, + { + accessorKey: "dmnAddr", header: "대표 URL", - }), - columnHelper.accessor("bscSiteYn", { - id: "bscSiteYn", + }, + { + accessorKey: "bscSiteYn", header: "기본 사이트 여부", - cell: (info) => (info.getValue() ? "Y" : "N"), - }), - columnHelper.accessor("useYn", { - id: "useYn", + }, + { + accessorKey: "useYn", header: "사용 여부", - cell: (info) => (info.getValue() ? "Y" : "N"), - }), - columnHelper.accessor("rgTrNm", { - id: "rgTrNm", + }, + { + accessorKey: "rgTrNm", header: "등록자", - }), - columnHelper.accessor("regDt", { - id: "regDt", + }, + { + accessorKey: "regDt", header: "등록일", - cell: (info) => { - const date = dayjs(info.getValue()); + cell: ({ row }) => { + const date = dayjs(row.original.regDt); return date.format("YYYY-MM-DD"); }, - }), + }, ]; - -export { columns }; diff --git a/apps/cs/src/pages/template/api/template-service.ts b/apps/cs/src/pages/template/api/template-service.ts new file mode 100644 index 000000000..d59447875 --- /dev/null +++ b/apps/cs/src/pages/template/api/template-service.ts @@ -0,0 +1,19 @@ +import { client } from "@/shared/api"; +import { ENDPOINT } from "@/shared/config"; +import type { + TemplateService, + TemplateList, + TemplateParams, +} from "../model/template-interface"; + +export class TemplateApiService implements TemplateService { + public async getTemplateList(params?: TemplateParams): Promise { + const response = await client.get( + `${ENDPOINT.CMS_SERVICE.TEMPLATE}`, + { params }, + ); + return response.data; + } +} + +export const TemplateApi = new TemplateApiService(); diff --git a/apps/cs/src/pages/template/index.ts b/apps/cs/src/pages/template/index.ts new file mode 100644 index 000000000..d6935f34f --- /dev/null +++ b/apps/cs/src/pages/template/index.ts @@ -0,0 +1 @@ +export { TemplatePage } from "./ui/template-page"; diff --git a/apps/cs/src/pages/template/model/template-interface.ts b/apps/cs/src/pages/template/model/template-interface.ts new file mode 100644 index 000000000..dfc0db485 --- /dev/null +++ b/apps/cs/src/pages/template/model/template-interface.ts @@ -0,0 +1,25 @@ +import type { PageableParams, PageableList } from "@/shared/model"; + +export interface TemplateParams extends PageableParams { + keywordType?: string; + keyword?: string; + tmpltSeCd?: string; + useYn?: string; +} + +export interface Template { + tmpltSn: number; + tmpltNm: string; + tmpltSeCd: string; + tmpltSeNm: string; + useYn: string; + mdfcnDt: string; + mdfr: string; + mdfrNm: string; +} + +export type TemplateList = PageableList