From 63afdfc726c3e8410fa2507ec38ddfd61c847c70 Mon Sep 17 00:00:00 2001 From: rsone001 Date: Thu, 5 Mar 2026 10:10:56 +0900 Subject: [PATCH] =?UTF-8?q?st:=20fix:=20db=20=ED=91=9C=EC=A4=80=ED=99=94?= =?UTF-8?q?=20=EC=9E=91=EC=97=85=EC=97=90=20=EB=A7=9E=EA=B2=8C=20interface?= =?UTF-8?q?=20=EB=B0=8F=20type=20=EC=88=98=EC=A0=95,=20middleware=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/st/middleware.ts | 33 ++++++------ .../components/button/CancelSubmitButton.tsx | 16 ++++++ apps/st/src/components/module/DataGrid.tsx | 18 +++---- apps/st/src/components/module/SearchForm.tsx | 4 +- .../input/SeweragePenetrationRateInp.tsx | 33 ++++++------ .../statistics/input/StatsInputStatusInp.tsx | 2 +- .../statistics/input/SubmitDailog.tsx | 50 +++++++++---------- .../statistics/management/LogHistory.tsx | 7 +++ .../st/src/components/type/SearchForm.type.ts | 2 - .../column/input/StatsInputStatusInpColumn.ts | 38 +++++++------- ...tatistics-input-sew-supply-rate-service.ts | 24 ++++----- .../api/statistics-input-status-service.ts | 13 ++--- .../api/statistics-management-service.ts | 24 ++++----- .../statistics/api/statistics-service.ts | 19 +++---- .../statistics-input-status-interface.ts | 16 +++--- .../statistics-input-submit-info-schema.ts | 16 +++--- ...tics-sewage-supply-rate-input-interface.ts | 44 ++++++++-------- apps/st/src/shared/api/client.ts | 11 +++- apps/st/src/shared/config/api.ts | 2 + 19 files changed, 197 insertions(+), 175 deletions(-) create mode 100644 apps/st/src/components/button/CancelSubmitButton.tsx create mode 100644 apps/st/src/components/statistics/management/LogHistory.tsx diff --git a/apps/st/middleware.ts b/apps/st/middleware.ts index 8b1ecb501..9a2a48cb1 100644 --- a/apps/st/middleware.ts +++ b/apps/st/middleware.ts @@ -12,10 +12,10 @@ import { const serverApiUrl = process.env.NEXT_PUBLIC_SERVER_API_URL ?? "http://localhost:3000"; -const linkBackendApiHost = process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST ?? "http://localhost:8080"; - const stServiceUrl = ST_SERVICE_URL; +const linkBackendApiHost = process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST ?? "http://localhost:8080"; + // CSP 헤더 설정 함수 (img-src만) function addSecurityHeaders(response: NextResponse): NextResponse { response.headers.set("Content-Security-Policy", "img-src 'self' data: https: blob:;"); @@ -28,41 +28,46 @@ export function middleware(req: NextRequest) { const logMessages: string[] = [ `[Middleware Request] ${new Date().toISOString()}`, - `[Environment]\n Mode: ${process.env.NODE_ENV}\n Port: ${PORT}\n Proxy Host: ${PROXY_HOST}\n Server API URL: ${SERVER_API_URL}\n Site ID: ${SITE_ID}`, + `[Environment]\n Mode: ${process.env.NODE_ENV}\n Port: ${PORT}\n Proxy Host: ${PROXY_HOST}\n Server API URL: ${SERVER_API_URL}\n Site ID: ${SITE_ID}\n ST Service URL: ${stServiceUrl}`, `[Request]\n Original Pathname: ${pathname}`, ]; - if (pathname.startsWith("/st-management-service") || pathname.startsWith("/st-input-service")) { + // ST Service 처리 (dc의 /server/dc-service 패턴과 동일) + if (pathname.startsWith("/server/st-management-service") || pathname.startsWith("/server/st-input-service")) { const requestHeaders = new Headers(req.headers); const token = req.cookies.get(CLAIM_NAME)?.value; const userId = req.cookies.get(AUTH_USER_ID)?.value; - + const queryParams = searchParams.toString(); - const newUrl = `${stServiceUrl}${pathname}${ + const newUrl = `${stServiceUrl}${pathname.replace("/server", "")}${ queryParams ? `?${queryParams}` : "" }`; if (token) requestHeaders.set(CLAIM_NAME, token); if (userId) requestHeaders.set(AUTH_USER_ID, userId); - - // 디버깅을 위한 토큰 정보 로그 - logMessages.push(` Token Debug: ${token ? 'EXISTS' : 'MISSING'}`); - logMessages.push(` UserId Debug: ${userId ? 'EXISTS' : 'MISSING'}`); + + logMessages.push(` Token Debug: ${token ? "EXISTS" : "MISSING"}`); + logMessages.push(` UserId Debug: ${userId ? "EXISTS" : "MISSING"}`); logMessages.push(` ST Service Rewritten URL: ${newUrl}`); logMessages.push("\n--------------------------------\n"); console.log(logMessages.join("\n")); - + const response = NextResponse.rewrite(new URL(newUrl), { headers: requestHeaders, }); return addSecurityHeaders(response); } - if (pathname.startsWith("/server")) { + // 일반 Server API 처리 (ST 서비스 제외) + if ( + pathname.startsWith("/server") && + !pathname.startsWith("/server/st-management-service") && + !pathname.startsWith("/server/st-input-service") + ) { const requestHeaders = new Headers(req.headers); const token = req.cookies.get(CLAIM_NAME)?.value; const userId = req.cookies.get(AUTH_USER_ID)?.value; - + const queryParams = searchParams.toString(); const newUrl = `${serverApiUrl}${pathname.replace("/server", "")}${ queryParams ? `?${queryParams}` : "" @@ -138,5 +143,5 @@ export function middleware(req: NextRequest) { } export const config = { - matcher: ["/server/:path*", "/attach-service/:path*", "/api/link/:path*", "/st-management-service/:path*", "/st-input-service/:path*", "/"], + matcher: ["/server/:path*", "/attach-service/:path*", "/api/link/:path*", "/"], }; diff --git a/apps/st/src/components/button/CancelSubmitButton.tsx b/apps/st/src/components/button/CancelSubmitButton.tsx new file mode 100644 index 000000000..c8b7c510f --- /dev/null +++ b/apps/st/src/components/button/CancelSubmitButton.tsx @@ -0,0 +1,16 @@ +import { Button } from "@common/components"; + +interface CancelSubmitButtonProps { + cnacelSubmitFunc: () => void; +} + +const CancelSubmitButton = ({ cnacelSubmitFunc }: CancelSubmitButtonProps) => { + return ( + + ); +}; + +export default CancelSubmitButton; \ No newline at end of file diff --git a/apps/st/src/components/module/DataGrid.tsx b/apps/st/src/components/module/DataGrid.tsx index 539c55cdd..cc1c65613 100644 --- a/apps/st/src/components/module/DataGrid.tsx +++ b/apps/st/src/components/module/DataGrid.tsx @@ -1039,21 +1039,21 @@ const DataGrid = ({ {statusInfo &&
진행상황: { - statusInfo.locgStatus === null || statusInfo.locgStatus === '0' ? + statusInfo.laeSbmsnSttsCd === null || statusInfo.laeSbmsnSttsCd === '0' ? '미작성' : - statusInfo.locgStatus === '1' ? '작성중' : statusInfo.locgStatus === '2' ? '제출' + statusInfo.laeSbmsnSttsCd === '1' ? '작성중' : statusInfo.laeSbmsnSttsCd === '2' ? '제출' : - statusInfo.locgStatus === '3' ? '승인' : '반려' + statusInfo.laeSbmsnSttsCd === '3' ? '승인' : '반려' } - 제출일: {statusInfo.locgDt - ? (statusInfo.locgDt.length === 8 && /^\d{8}$/.test(statusInfo.locgDt) - ? `${statusInfo.locgDt.slice(0, 4)}-${statusInfo.locgDt.slice(4, 6)}-${statusInfo.locgDt.slice(6, 8)}` - : statusInfo.locgDt) + 제출일: {statusInfo.laeSbmsnYmd + ? (statusInfo.laeSbmsnYmd.length === 8 && /^\d{8}$/.test(statusInfo.laeSbmsnYmd) + ? `${statusInfo.laeSbmsnYmd.slice(0, 4)}-${statusInfo.laeSbmsnYmd.slice(4, 6)}-${statusInfo.laeSbmsnYmd.slice(6, 8)}` + : statusInfo.laeSbmsnYmd) : '미제출'} - 담당자: {statusInfo.locgCharger ? statusInfo.locgCharger : '-'} - 연락처: {statusInfo.locgCttpc ? statusInfo.locgCttpc : '-'} + 담당자: {statusInfo.laePicNm ? statusInfo.laePicNm : '-'} + 연락처: {statusInfo.laePicTelNo ? statusInfo.laePicTelNo : '-'}
} {isExcelImport && ( diff --git a/apps/st/src/components/module/SearchForm.tsx b/apps/st/src/components/module/SearchForm.tsx index 1b2899fd2..10221d304 100644 --- a/apps/st/src/components/module/SearchForm.tsx +++ b/apps/st/src/components/module/SearchForm.tsx @@ -67,9 +67,9 @@ const SearchForm = (props: SearchFormProps = {}) => { bsnmCd: props.defaultValues?.bsnmCd || '', }); - // isStatusMenu면 bsnmCd가 doList에 있을 때만 시군구 조회. 선택 후 옵션 유지를 위해 마지막 목록 ref 사용 const sggKey: [string, string] | null = - values.sido && values.sido !== "ALL" && (!mergedProps.isStatusMenu || doList.includes(values.bsnmCd ?? "")) + // values.sido && values.sido !== "ALL" && doList.includes(values.bsnmCd ?? "") + values.sido && values.sido !== "ALL" ? ["sgg-list", values.sido] : null; const { data: sggList } = useSWR>( diff --git a/apps/st/src/components/statistics/input/SeweragePenetrationRateInp.tsx b/apps/st/src/components/statistics/input/SeweragePenetrationRateInp.tsx index d4eaa39d6..feab264cb 100644 --- a/apps/st/src/components/statistics/input/SeweragePenetrationRateInp.tsx +++ b/apps/st/src/components/statistics/input/SeweragePenetrationRateInp.tsx @@ -7,6 +7,7 @@ import SubmitButton from "@/components/button/SumitButton"; import SaveButton from "@/components/button/SaveButton"; import LastYearDataButton from "@/components/button/LastYearDataButton"; import SubmitExceptionButton from "@/components/button/SubmitExceptionButton"; +import CancelSubmitButton from "@/components/button/CancelSubmitButton"; import { LoadingWithAnimation } from "@common/components"; import { ConfirmDialog } from "@/shared/ui/confirm-dialog"; import SubmitDailog from "./SubmitDailog"; @@ -123,16 +124,16 @@ const SeweragePenetrationRateInp = () => { setFooterFromApi( commonInfo ? { - totalPopl: commonInfo.sewerBzmnTotalPopl, - poplSm: commonInfo.sewerBzmnPoplSm, - frgnrPoplSm: commonInfo.sewerBzmnFrgnrPoplSm, + totalPopl: commonInfo.sewerBzmnWholPpltnCnt, + poplSm: commonInfo.sewerBzmnDomplWholPpltnCnt, + frgnrPoplSm: commonInfo.sewerBzmnFrgnrWholPpltnCnt, refArea: commonInfo.sewerBzmnArea, } : null ); - if (statusInfo && statusInfo.locgStatus) { - if (['2', '3'].includes(statusInfo.locgStatus)) { + if (statusInfo && statusInfo.laeSbmsnSttsCd) { + if (['2', '3'].includes(statusInfo.laeSbmsnSttsCd)) { setIsEnterable(false); } else { setIsEnterable(isEnterable); @@ -267,15 +268,15 @@ const SeweragePenetrationRateInp = () => { statsYr: searchValues?.year ?? '', userId: userInfo.userUnqId, submitList: convertedData, - sewerBzmnFrgnrPoplSm: footerFromApi?.frgnrPoplSm, - locgCharger: submitInfo.locgCharger, - locgJob: submitInfo.locgJob, - locgDept: submitInfo.locgDept, - locgCttpc: submitInfo.locgCttpc, - locgCnfirmNm: submitInfo.locgCnfirmNm, - locgCnfirmJob: submitInfo.locgCnfirmJob, - locgCnfirmDept: submitInfo.locgCnfirmDept, - locgCnfirmPh: submitInfo.locgCnfirmPh, + sewerBzmnFrgnrWholPpltnCnt: footerFromApi?.frgnrPoplSm, + laePicNm: submitInfo.laePicNm, + laeKbrdrJbgdNm: submitInfo.laeKbrdrJbgdNm, + laeKbrdrDeptNm: submitInfo.laeKbrdrDeptNm, + laePicTelNo: submitInfo.laePicTelNo, + laeIdfrNm: submitInfo.laeIdfrNm, + laeIdfrJbgdNm: submitInfo.laeIdfrJbgdNm, + laeIdfrDeptNm: submitInfo.laeIdfrDeptNm, + laeIdfrTelNo: submitInfo.laeIdfrTelNo, }; const response = await StatisticsInputSewSupplyRateApi.submitSewerageSupplyRate(requestData); @@ -369,7 +370,7 @@ const SeweragePenetrationRateInp = () => { statsYr: searchValues?.year ?? '', // 통계 연도 userId: userInfo.userUnqId, // 사용자 saveList: convertedData, // 저장 데이터 - sewerBzmnFrgnrPoplSm: footerFromApi?.frgnrPoplSm // 행정참고자료 외국인 합계 + sewerBzmnFrgnrWholPpltnCnt: footerFromApi?.frgnrPoplSm // 행정참고자료 외국인 합계 }; if (isAdminInfo) { @@ -406,8 +407,10 @@ const SeweragePenetrationRateInp = () => { getLastYearDataFunc(searchValues ?? {})} /> + )} + {statusInfo?.laeSbmsnSttsCd === '2' && console.log('test')} />} {(isEnterable && (doList.includes(lastSearchedValues?.bsnmCd || '') ? Boolean(lastSearchedValues?.gugun && lastSearchedValues.gugun !== 'ALL') : true) || isAdminInfo) && } diff --git a/apps/st/src/components/statistics/input/StatsInputStatusInp.tsx b/apps/st/src/components/statistics/input/StatsInputStatusInp.tsx index 057ba5b88..00641e312 100644 --- a/apps/st/src/components/statistics/input/StatsInputStatusInp.tsx +++ b/apps/st/src/components/statistics/input/StatsInputStatusInp.tsx @@ -66,7 +66,7 @@ const StatsInputStatusInp = () => { return ( <>
- +
diff --git a/apps/st/src/components/statistics/input/SubmitDailog.tsx b/apps/st/src/components/statistics/input/SubmitDailog.tsx index 6d0bbbd12..b286117b7 100644 --- a/apps/st/src/components/statistics/input/SubmitDailog.tsx +++ b/apps/st/src/components/statistics/input/SubmitDailog.tsx @@ -37,7 +37,7 @@ function formatPhoneWithHyphen(value: string): string { return `${digits.slice(0, 3)}-${digits.slice(3, 6)}-${digits.slice(6, 10)}`; } -const PHONE_FIELDS: (keyof StatisticsInputSubmitInfoFormData)[] = ["locgCttpc", "locgCnfirmPh"]; +const PHONE_FIELDS: (keyof StatisticsInputSubmitInfoFormData)[] = ["laePicTelNo", "laeIdfrTelNo"]; interface SubmitDialogProps { open: boolean; @@ -48,26 +48,26 @@ interface SubmitDialogProps { } const defaultValues: StatisticsInputSubmitInfoFormData = { - locgCharger: "", - locgJob: "", - locgDept: "", - locgCttpc: "", - locgCnfirmNm: "", - locgCnfirmJob: "", - locgCnfirmDept: "", - locgCnfirmPh: "", + laePicNm: "", + laeKbrdrJbgdNm: "", + laeKbrdrDeptNm: "", + laePicTelNo: "", + laeIdfrNm: "", + laeIdfrJbgdNm: "", + laeIdfrDeptNm: "", + laeIdfrTelNo: "", }; function statusInfoToFormData(info: SewerageSupplyRateStatusInfo): StatisticsInputSubmitInfoFormData { return { - locgCharger: info.locgCharger ?? "", - locgJob: info.locgJob ?? "", - locgDept: info.locgDept ?? "", - locgCttpc: info.locgCttpc ?? "", - locgCnfirmNm: info.locgCnfirmNm ?? "", - locgCnfirmJob: info.locgCnfirmJob ?? "", - locgCnfirmDept: info.locgCnfirmDept ?? "", - locgCnfirmPh: info.locgCnfirmPh ?? "", + laePicNm: info.laePicNm ?? "", + laeKbrdrJbgdNm: info.laeKbrdrJbgdNm ?? "", + laeKbrdrDeptNm: info.laeKbrdrDeptNm ?? "", + laePicTelNo: info.laePicTelNo ?? "", + laeIdfrNm: info.laeIdfrNm ?? "", + laeIdfrJbgdNm: info.laeIdfrJbgdNm ?? "", + laeIdfrDeptNm: info.laeIdfrDeptNm ?? "", + laeIdfrTelNo: info.laeIdfrTelNo ?? "", }; } @@ -95,14 +95,14 @@ const SubmitDailog = ({ open, onOpenChange, statusInfo, onConfirm }: SubmitDialo } const rows: { name: keyof StatisticsInputSubmitInfoFormData; label: string; placeholder: string }[] = [ - { name: "locgCharger", label: "작성자 명", placeholder: "작성자 명 입력" }, - { name: "locgJob", label: "작성자 직제", placeholder: "작성자 직제 입력" }, - { name: "locgDept", label: "작성자 부서", placeholder: "작성자 부서 입력" }, - { name: "locgCttpc", label: "작성자 연락처", placeholder: "작성자 연락처 입력" }, - { name: "locgCnfirmNm", label: "승인자명", placeholder: "승인자명 입력" }, - { name: "locgCnfirmJob", label: "승인자 직제", placeholder: "승인자 직제 입력" }, - { name: "locgCnfirmDept", label: "승인자 부서", placeholder: "승인자 부서 입력" }, - { name: "locgCnfirmPh", label: "승인자 연락처", placeholder: "승인자 연락처" }, + { name: "laePicNm", label: "작성자 명", placeholder: "작성자 명 입력" }, + { name: "laeKbrdrJbgdNm", label: "작성자 직제", placeholder: "작성자 직제 입력" }, + { name: "laeKbrdrDeptNm", label: "작성자 부서", placeholder: "작성자 부서 입력" }, + { name: "laePicTelNo", label: "작성자 연락처", placeholder: "작성자 연락처 입력" }, + { name: "laeIdfrNm", label: "승인자명", placeholder: "승인자명 입력" }, + { name: "laeIdfrJbgdNm", label: "승인자 직제", placeholder: "승인자 직제 입력" }, + { name: "laeIdfrDeptNm", label: "승인자 부서", placeholder: "승인자 부서 입력" }, + { name: "laeIdfrTelNo", label: "승인자 연락처", placeholder: "승인자 연락처" }, ]; return ( diff --git a/apps/st/src/components/statistics/management/LogHistory.tsx b/apps/st/src/components/statistics/management/LogHistory.tsx new file mode 100644 index 000000000..5950c1125 --- /dev/null +++ b/apps/st/src/components/statistics/management/LogHistory.tsx @@ -0,0 +1,7 @@ +const LogHistory = () => { + return ( + <> + ); +}; + +export default LogHistory; \ No newline at end of file diff --git a/apps/st/src/components/type/SearchForm.type.ts b/apps/st/src/components/type/SearchForm.type.ts index f3668b56c..b6fd4211d 100644 --- a/apps/st/src/components/type/SearchForm.type.ts +++ b/apps/st/src/components/type/SearchForm.type.ts @@ -18,7 +18,6 @@ export type SearchFormProps = { onReset?: () => void; onValuesChange?: (values: SearchFormValues) => void; defaultValues?: SearchFormValues; - isStatusMenu?: boolean; }; export const defaultSearchFormProps: Required> = { @@ -28,5 +27,4 @@ export const defaultSearchFormProps: Required 00. 통계 입력 현황 @@ -10,15 +10,15 @@ export const StatsInputStatusInpColumn = { { name: 'gugun', fieldName: 'gugun', header: { text: '시군구' }, editable: false }, { name: 'menuCd', fieldName: 'menuCd', header: { text: '메뉴코드' }, visible: false, editable: false }, { name: 'menuNm', fieldName: 'menuNm', header: { text: '구분' }, editable: false, width: 220 }, - { name: 'locgStatusNm', fieldName: 'locgStatusNm', header: { text: '진행상황' }, editable: false }, - { name: 'inputRate', fieldName: 'inputRate', header: { text: '작성률' }, editable: false, valueType: ValueType.NUMBER, dataFormat: '#,##0' }, - { name: 'locgCharger', fieldName: 'locgCharger', header: { text: '작성자' }, editable: false }, - { name: 'locgCttpc', fieldName: 'locgCttpc', header: { text: '작성자연락처' }, editable: false }, - { name: 'locgDept', fieldName: 'locgDept', header: { text: '부서' }, editable: false }, - { name: 'locgJob', fieldName: 'locgJob', header: { text: '직제' }, editable: false }, - { name: 'locgCnfirmNm', fieldName: 'locgCnfirmNm', header: { text: '승인자' }, editable: false }, - { name: 'locgCnfirmDept', fieldName: 'locgCnfirmDept', header: { text: '부서' }, editable: false }, - { name: 'locgCnfirmJob', fieldName: 'locgCnfirmJob', header: { text: '직제' }, editable: false }, + { name: 'laeSbmsnSttsCdNm', fieldName: 'laeSbmsnSttsCdNm', header: { text: '진행상황' }, editable: false }, + // { name: 'inputRate', fieldName: 'inputRate', header: { text: '작성률' }, editable: false, valueType: ValueType.NUMBER, dataFormat: '#,##0' }, + { name: 'laePicNm', fieldName: 'laePicNm', header: { text: '작성자' }, editable: false }, + { name: 'laePicTelNo', fieldName: 'laePicTelNo', header: { text: '작성자연락처' }, editable: false }, + { name: 'laeKbrdrDeptNm', fieldName: 'laeKbrdrDeptNm', header: { text: '부서' }, editable: false }, + { name: 'laeKbrdrJbgdNm', fieldName: 'laeKbrdrJbgdNm', header: { text: '직제' }, editable: false }, + { name: 'laeIdfrNm', fieldName: 'laeIdfrNm', header: { text: '승인자' }, editable: false }, + { name: 'laeIdfrDeptNm', fieldName: 'laeIdfrDeptNm', header: { text: '부서' }, editable: false }, + { name: 'laeIdfrJbgdNm', fieldName: 'laeIdfrJbgdNm', header: { text: '직제' }, editable: false }, { name: 'returnOpinionSm', fieldName: 'returnOpinionSm', header: { text: '반려사유' }, editable: false }, ], @@ -32,15 +32,15 @@ export const StatsInputStatusInpColumn = { hideChildHeaders: false, header: { text: '하수도사업자' }, items: [ - 'locgStatusNm', - 'inputRate', - 'locgCharger', - 'locgCttpc', - 'locgDept', - 'locgJob', - 'locgCnfirmNm', - 'locgCnfirmDept', - 'locgCnfirmJob', + 'laeSbmsnSttsCdNm', + // 'inputRate', + 'laePicNm', + 'laePicTelNo', + 'laeKbrdrDeptNm', + 'laeKbrdrJbgdNm', + 'laeIdfrNm', + 'laeIdfrDeptNm', + 'laeIdfrJbgdNm', 'returnOpinionSm' ], }, diff --git a/apps/st/src/entities/statistics/api/statistics-input-sew-supply-rate-service.ts b/apps/st/src/entities/statistics/api/statistics-input-sew-supply-rate-service.ts index dbd9d3fb8..ba6d10874 100644 --- a/apps/st/src/entities/statistics/api/statistics-input-sew-supply-rate-service.ts +++ b/apps/st/src/entities/statistics/api/statistics-input-sew-supply-rate-service.ts @@ -1,7 +1,7 @@ -import axios from "axios"; import { ENDPOINT } from "@/shared/config"; +import { stClient } from "@/shared/api/client"; -import { +import { type StatisticsInputSewSupplyRateService, type SewerageSupplyRateRequestParams, type SewerageSupplyRateApiResponse, @@ -12,39 +12,33 @@ import { export class StatisticsInputSewSupplyRateApiService implements StatisticsInputSewSupplyRateService { public async getSewerageSupplyRateList(params: SewerageSupplyRateRequestParams): Promise { - const response = await axios.get ( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.INPUT}/sewerage-supply-rate`, - { - params: params - } + { params } ); - return response.data; } public async checkInputPeriod(params: string): Promise { - const response = await axios.get ( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.INPUTCOMMON}/check-input-period?year=${params}`, ); - return response.data; } public async saveSewerageSupplyRate(params: SewerageSupplyRateSaveRequest): Promise { - const response = await axios.post ( + const response = await stClient.post( `${ENDPOINT.ST_SERVICE.INPUT}/sewerage-supply-rate`, - params + params, ); - return response.data; } public async submitSewerageSupplyRate(params: SewerageSupplyRateSaveRequest): Promise { - const response = await axios.post ( + const response = await stClient.post( `${ENDPOINT.ST_SERVICE.INPUT}/sewerage-supply-rate/submit`, - params + params, ); - return response.data; } } diff --git a/apps/st/src/entities/statistics/api/statistics-input-status-service.ts b/apps/st/src/entities/statistics/api/statistics-input-status-service.ts index 5dd094e66..cd3c55a5f 100644 --- a/apps/st/src/entities/statistics/api/statistics-input-status-service.ts +++ b/apps/st/src/entities/statistics/api/statistics-input-status-service.ts @@ -1,7 +1,7 @@ -import axios from "axios"; import { ENDPOINT } from "@/shared/config"; +import { stClient } from "@/shared/api/client"; -import type { +import type { StatisticsInputStatusService, StatsInputStatusListRequestParams, StatsInputStatusListApiResponse, @@ -9,15 +9,12 @@ import type { export class StatisticsInputStatusApiService implements StatisticsInputStatusService { public async getStatisticsInputStatusList(param: StatsInputStatusListRequestParams): Promise { - const response = await axios.get ( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.INPUT}/stats-input-status`, - { - params: param - } + { params: param }, ); - return response.data; - }; + } } export const StatisticsInputStatusApi = new StatisticsInputStatusApiService(); \ No newline at end of file diff --git a/apps/st/src/entities/statistics/api/statistics-management-service.ts b/apps/st/src/entities/statistics/api/statistics-management-service.ts index 309a7b2f3..1e2a6336d 100644 --- a/apps/st/src/entities/statistics/api/statistics-management-service.ts +++ b/apps/st/src/entities/statistics/api/statistics-management-service.ts @@ -1,5 +1,5 @@ -import axios from "axios"; import { ENDPOINT } from "@/shared/config"; +import { stClient } from "@/shared/api/client"; import { @@ -38,7 +38,7 @@ export class StatisticsManagementApiService { public async getStatsInputStatusList( params: { yr?: string; bsnmCd?: string; sido?: string; gugun?: string } ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/input-status`, { params } ); @@ -52,7 +52,7 @@ export class StatisticsManagementApiService { public async getSewerageSupplyRateReviewList( params: SewerageSupplyRateReviewRequestParams ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/supply-rate`, { params } ); @@ -66,7 +66,7 @@ export class StatisticsManagementApiService { public async getSewagePipeReviewRegionalList( params: SewagePipeReviewRequestParams ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/sewer-pipe/regional-status`, { params } ); @@ -80,7 +80,7 @@ export class StatisticsManagementApiService { public async getSewagePipeFacilityList( params: SewagePipeReviewRequestParams ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/sewer-pipe/facility-status`, { params } ); @@ -99,7 +99,7 @@ export class StatisticsManagementApiService { gugun?: string; } ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/sewer-pipe/type-status`, { params } ); @@ -118,7 +118,7 @@ export class StatisticsManagementApiService { gugun?: string; } ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/sewer-pipe/diam-status`, { params } ); @@ -132,7 +132,7 @@ export class StatisticsManagementApiService { public async getSewerPipeMtcList( params: SewerPipeMtcRequestParams ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/sewer-pipe-mtc/repair`, { params } ); @@ -151,7 +151,7 @@ export class StatisticsManagementApiService { gugun?: string; } ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/sewer-pipe-mtc/dredging`, { params } ); @@ -170,7 +170,7 @@ export class StatisticsManagementApiService { gugun?: string; } ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/sewer-reservoir/facilities`, { params } ); @@ -189,7 +189,7 @@ export class StatisticsManagementApiService { gugun?: string; } ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/sewer-reservoir/pumping-stations`, { params } ); @@ -209,7 +209,7 @@ export class StatisticsManagementApiService { bscFctNm?: string; // 펌프장명 (시설명) } ): Promise { - const response = await axios.get( + const response = await stClient.get( `${ENDPOINT.ST_SERVICE.REVIEW}/mediation-pump-stations`, { params } ); diff --git a/apps/st/src/entities/statistics/api/statistics-service.ts b/apps/st/src/entities/statistics/api/statistics-service.ts index 8455e68c5..f75163e5c 100644 --- a/apps/st/src/entities/statistics/api/statistics-service.ts +++ b/apps/st/src/entities/statistics/api/statistics-service.ts @@ -1,33 +1,26 @@ -import axios from "axios"; import { ENDPOINT } from "@/shared/config"; +import { stClient } from "@/shared/api/client"; import { type StatisticsService, type SearchCondition, type ApiResponse, - type Sgg + type Sgg, } from "../model/statistics-interface"; export class StatisticsAPiService implements StatisticsService { - public async getSidoList(): Promise> { - const response = await axios.get>( + const response = await stClient.get>( `${ENDPOINT.ST_SERVICE.COMMON}/search-condition`, ); - return response.data; - }; + } public async getSggList(sidoName: string): Promise> { - const response = await axios.get>( + const response = await stClient.get>( `${ENDPOINT.ST_SERVICE.COMMON}/sgg`, - { - params: { - sidoName: sidoName, - }, - } + { params: { sidoName } }, ); - return response.data; } } diff --git a/apps/st/src/entities/statistics/model/statistics-input-status-interface.ts b/apps/st/src/entities/statistics/model/statistics-input-status-interface.ts index 47637923f..b0fa51d0d 100644 --- a/apps/st/src/entities/statistics/model/statistics-input-status-interface.ts +++ b/apps/st/src/entities/statistics/model/statistics-input-status-interface.ts @@ -13,15 +13,15 @@ export interface StatsInputStatusList { gugun?: string; menuCd?: string; menuNm?: string; - locgStatusNm?: string; + laeSbmsnSttsCdNm?: string; inputRate?: number; - locgCharger?: string; - locgCttpc?: string; - locgDept?: string; - locgJob?: string; - locgCnfirmNm?: string; - locgCnfirmDept?: string; - locgCnfirmJob?: string; + laePicNm?: string; + laePicTelNo?: string; + laeKbrdrDeptNm?: string; + laeKbrdrJbgdNm?: string; + laeIdfrNm?: string; + laeIdfrDeptNm?: string; + laeIdfrJbgdNm?: string; returnOpinionSm?: string; } diff --git a/apps/st/src/entities/statistics/model/statistics-input-submit-info-schema.ts b/apps/st/src/entities/statistics/model/statistics-input-submit-info-schema.ts index fb3380b6b..623d037df 100644 --- a/apps/st/src/entities/statistics/model/statistics-input-submit-info-schema.ts +++ b/apps/st/src/entities/statistics/model/statistics-input-submit-info-schema.ts @@ -2,14 +2,14 @@ import { z } from "zod"; export const statisticsInputSubmitInfoSchema = z.object({ // 작성자 명, 작성자 직제, 작성자 부서, 작성자 연락처, 승인자명, 승인자 직제, 승인자 부서, 승인자 연락처 (전부 필수) - locgCharger: z.string().min(1, "작성자 명을 입력하세요"), - locgJob: z.string().min(1, "작성자 직제를 입력하세요"), - locgDept: z.string().min(1, "작성자 부서를 입력하세요"), - locgCttpc: z.string().min(1, "작성자 연락처를 입력하세요"), - locgCnfirmNm: z.string().min(1, "승인자명을 입력하세요"), - locgCnfirmJob: z.string().min(1, "승인자 직제를 입력하세요"), - locgCnfirmDept: z.string().min(1, "승인자 부서를 입력하세요"), - locgCnfirmPh: z.string().min(1, "승인자 연락처를 입력하세요"), + laePicNm: z.string().min(1, "작성자 명을 입력하세요"), + laeKbrdrJbgdNm: z.string().min(1, "작성자 직제를 입력하세요"), + laeKbrdrDeptNm: z.string().min(1, "작성자 부서를 입력하세요"), + laePicTelNo: z.string().min(1, "작성자 연락처를 입력하세요"), + laeIdfrNm: z.string().min(1, "승인자명을 입력하세요"), + laeIdfrJbgdNm: z.string().min(1, "승인자 직제를 입력하세요"), + laeIdfrDeptNm: z.string().min(1, "승인자 부서를 입력하세요"), + laeIdfrTelNo: z.string().min(1, "승인자 연락처를 입력하세요"), }); export type StatisticsInputSubmitInfoFormData = z.infer< diff --git a/apps/st/src/entities/statistics/model/statistics-sewage-supply-rate-input-interface.ts b/apps/st/src/entities/statistics/model/statistics-sewage-supply-rate-input-interface.ts index 8ed9340ea..f9ba8843d 100644 --- a/apps/st/src/entities/statistics/model/statistics-sewage-supply-rate-input-interface.ts +++ b/apps/st/src/entities/statistics/model/statistics-sewage-supply-rate-input-interface.ts @@ -2,29 +2,29 @@ import type { ApiResponse } from "./statistics-interface"; // 하수도 보급률 데이터 항목 export interface SewerageSupplyRateStatusInfo { - locgStatus: string | null; - locgDt: string | null; - locgCharger: string | null; - locgCttpc: string | null; - locgJob: string | null; + laeSbmsnSttsCd: string | null; + laeSbmsnYmd: string | null; + laePicNm: string | null; + laePicTelNo: string | null; + laeKbrdrJbgdNm: string | null; prvnStatus: string | null; dcsnStatus: string | null; wrterOpinionSm: string | null; chckerOpinionSm: string | null; returnOpinionSm: string | null; - locgCnfirmDept: string | null; - locgCnfirmJob: string | null; - locgCnfirmNm: string | null; - locgCnfirmPh: string | null; - locgDept: string | null; + laeIdfrDeptNm: string | null; + laeIdfrJbgdNm: string | null; + laeIdfrNm: string | null; + laeIdfrTelNo: string | null; + laeKbrdrDeptNm: string | null; } export interface SewerageSupplyRateCommonInfo { sewerBzmnArea: number; sewerBzmnCd: string; - sewerBzmnFrgnrPoplSm: number; - sewerBzmnPoplSm: number; - sewerBzmnTotalPopl: number; + sewerBzmnFrgnrWholPpltnCnt: number; + sewerBzmnDomplWholPpltnCnt: number; + sewerBzmnWholPpltnCnt: number; piplFcltyExtn: number; piplPlanExtn: number; swagePplPsplyRt: number; @@ -135,17 +135,17 @@ export interface SewerageSupplyRateSaveRequest { ctpvNm: string; sewerBzmnCd: string; userId: string; - sewerBzmnFrgnrPoplSm?: number; + sewerBzmnFrgnrWholPpltnCnt?: number; saveList?: SewerageSupplyRateSaveItem[]; submitList?: SewerageSupplyRateSaveItem[]; - locgCharger?: string; - locgJob?: string; - locgDept?: string; - locgCttpc?: string; - locgCnfirmNm?: string; - locgCnfirmJob?: string; - locgCnfirmDept?: string; - locgCnfirmPh?: string; + laePicNm?: string; + laeKbrdrJbgdNm?: string; + laeKbrdrDeptNm?: string; + laePicTelNo?: string; + laeIdfrNm?: string; + laeIdfrJbgdNm?: string; + laeIdfrDeptNm?: string; + laeIdfrTelNo?: string; superAdmin?: string; } diff --git a/apps/st/src/shared/api/client.ts b/apps/st/src/shared/api/client.ts index f4696eb1d..a973ae6b4 100644 --- a/apps/st/src/shared/api/client.ts +++ b/apps/st/src/shared/api/client.ts @@ -1,11 +1,18 @@ +import axios, { type AxiosInstance } from "axios"; import { Client } from "@common/network"; -import { BASE_URL } from "../config/api"; -import { SITE_ID } from "../config/env"; +import { BASE_URL, ST_SERVICE_BASE_URL } from "../config/api"; +import { AUTH_USER_ID, CLAIM_NAME, SITE_ID } from "../config/env"; import { setCookie } from "../lib"; +import Cookies from "js-cookie"; setCookie("site-id-key", SITE_ID); export const client = Client.getInstance({ baseURL: BASE_URL, siteId: SITE_ID, +}); + +export const stClient = Client.getInstance({ + baseURL: ST_SERVICE_BASE_URL, + siteId: SITE_ID, }); \ No newline at end of file diff --git a/apps/st/src/shared/config/api.ts b/apps/st/src/shared/config/api.ts index 1b9cf74ec..6a69bcc64 100644 --- a/apps/st/src/shared/config/api.ts +++ b/apps/st/src/shared/config/api.ts @@ -2,6 +2,8 @@ import { PROXY_HOST } from "./env"; export const BASE_URL = `${PROXY_HOST}/server`; +export const ST_SERVICE_BASE_URL = `${PROXY_HOST}/server`; + export const ENDPOINT = { ATTACH_SERVICE: { TUS_UPLOAD: "/attach-service/api/v1/tus/upload",