From e79590b70df6878720e83899e68784377f2fe38a Mon Sep 17 00:00:00 2001 From: rsone001 Date: Tue, 10 Feb 2026 17:15:41 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20service=20=ED=86=B5=ED=95=A9,?= =?UTF-8?q?=EC=9D=B8=ED=84=B0=ED=8E=98=EC=9D=B4=EC=8A=A4=20=EB=84=A4?= =?UTF-8?q?=EC=9D=B4=EB=B0=8D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/statistics-input-review-service.ts | 39 -------- .../api/statistics-management-service.ts | 67 ++++++++++++-- .../statistics-sewage-pipe-review-service.ts | 34 ------- .../statistics-input-review-interface.ts | 2 +- .../model/statistics-management-interface.ts | 92 ------------------- 5 files changed, 59 insertions(+), 175 deletions(-) delete mode 100644 apps/st/src/entities/statistics/api/statistics-input-review-service.ts delete mode 100644 apps/st/src/entities/statistics/api/statistics-sewage-pipe-review-service.ts delete mode 100644 apps/st/src/entities/statistics/model/statistics-management-interface.ts diff --git a/apps/st/src/entities/statistics/api/statistics-input-review-service.ts b/apps/st/src/entities/statistics/api/statistics-input-review-service.ts deleted file mode 100644 index 4977e0a58..000000000 --- a/apps/st/src/entities/statistics/api/statistics-input-review-service.ts +++ /dev/null @@ -1,39 +0,0 @@ -import axios from "axios"; -import { ENDPOINT } from "@/shared/config"; - -import { - type StatsInputStatusReviewService, - type StatsInputStatusReviewApiResponse, -} from "../model/statistics-input-review-interface"; - -export class StatsInputStatusReviewApiService implements StatsInputStatusReviewService { - /** - * 통계 입력 현황 목록 조회 - * @param params (yr, bsnmCd, sido, gugun) - */ - public async getStatsInputStatusList( - params: { yr?: string; bsnmCd?: string; sido?: string; gugun?: string } - ): Promise { - const response = await axios.get( - - `${ENDPOINT.ST_SERVICE.REVIEW}/input-status`, - { - params: params - } - ); - - return response.data; - } - - public async checkInputPeriod(params: string | number): Promise { - const response = await axios.get( - `${ENDPOINT.ST_SERVICE.INPUTCOMMON}/check-input-period?year=${params}` - ); - - return response.data; - } - - -} - -export const statsInputStatusReviewApi = new StatsInputStatusReviewApiService(); \ 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 443b83091..b566d19c3 100644 --- a/apps/st/src/entities/statistics/api/statistics-management-service.ts +++ b/apps/st/src/entities/statistics/api/statistics-management-service.ts @@ -1,16 +1,47 @@ import axios from "axios"; import { ENDPOINT } from "@/shared/config"; + +import { + type StatsInputStatusReviewApiResponse +} from "../model/statistics-input-review-interface"; +import { + type SewagePipeReviewApiResponse +} from "../model/statistics-sewage-pipe-review-interface"; import { - type SewerageSupplyRateReviewService, type SewerageSupplyRateReviewRequestParams, type SewerageSupplyRateReviewApiResponse, -} from "../model/statistics-management-interface"; +} from "../model/statistics-sewerage-penetration-review-interface"; - -export class SewerageSupplyRateReviewApiService implements SewerageSupplyRateReviewService { +export class StatisticsManagementApiService { /** - * 하수도 보급률 검토 목록 조회 + * 00. 통계 입력 현황 목록 조회 + * @param params (yr, bsnmCd, sido, gugun) + */ + public async getStatsInputStatusList( + params: { yr?: string; bsnmCd?: string; sido?: string; gugun?: string } + ): Promise { + const response = await axios.get( + `${ENDPOINT.ST_SERVICE.REVIEW}/input-status`, + { params } + ); + return response.data; + } + + /** + * 입력 기간 확인 (공통) + * @param year 연도 + */ + public async checkInputPeriod(year: string | number): Promise { + const response = await axios.get( + `${ENDPOINT.ST_SERVICE.INPUTCOMMON}/check-input-period`, + { params: { year } } + ); + return response.data; + } + + /** + * 01. 하수도 보급률 검토 목록 조회 * @param params (sido, gugun, yr, bsnmCd) */ public async getSewerageSupplyRateReviewList( @@ -18,12 +49,30 @@ export class SewerageSupplyRateReviewApiService implements SewerageSupplyRateRev ): Promise { const response = await axios.get( `${ENDPOINT.ST_SERVICE.REVIEW}/supply-rate`, - { - params: params - } + { params } ); + return response.data; + } + /** + * 02. 하수관로 지역별 시설현황 목록 조회 (Tab1) + * @param params (sido, gugun, yr, bsnmCd) + */ + public async getSewagePipeReviewList( + params: { + yr?: string; + bsnmCd?: string; + sido?: string; + gugun?: string; + } + ): Promise { + const response = await axios.get( + `${ENDPOINT.ST_SERVICE.REVIEW}/pipe/tab1`, + { params } + ); return response.data; } } -export const sewerageSupplyRateReviewApi = new SewerageSupplyRateReviewApiService(); \ No newline at end of file + +// 통합 인스턴스 수출 +export const statisticsManagementApi = new StatisticsManagementApiService(); \ No newline at end of file diff --git a/apps/st/src/entities/statistics/api/statistics-sewage-pipe-review-service.ts b/apps/st/src/entities/statistics/api/statistics-sewage-pipe-review-service.ts deleted file mode 100644 index 67d3b9cac..000000000 --- a/apps/st/src/entities/statistics/api/statistics-sewage-pipe-review-service.ts +++ /dev/null @@ -1,34 +0,0 @@ -import axios from "axios"; -import { ENDPOINT } from "@/shared/config"; - -import { - type SewagePipeReviewService, - type SewagePipeReviewApiResponse, -} from "../model/statistics-sewage-pipe-review-interface"; - - -export class SewagePipeReviewApiService implements SewagePipeReviewService { - /** - * 02. 하수관로 지역별 시설현황 목록 조회 (Tab1) - * @param params (sido, gugun, yr, bsnmCd) - */ - public async getSewagePipeReviewList( - params: { - yr?: string; - bsnmCd?: string; - sido?: string; - gugun?: string; - } - ): Promise { - const response = await axios.get( - `${ENDPOINT.ST_SERVICE.REVIEW}/pipe/tab1`, - { - params: params - } - ); - - return response.data; - } -} - -export const sewagePipeReviewApi = new SewagePipeReviewApiService(); \ No newline at end of file diff --git a/apps/st/src/entities/statistics/model/statistics-input-review-interface.ts b/apps/st/src/entities/statistics/model/statistics-input-review-interface.ts index a10edbad1..93f1a4651 100644 --- a/apps/st/src/entities/statistics/model/statistics-input-review-interface.ts +++ b/apps/st/src/entities/statistics/model/statistics-input-review-interface.ts @@ -1,7 +1,7 @@ import type { ApiResponse } from "./statistics-interface"; /** - * 00.검토-통계 입력현황 아이템 인터페이스 + * 검토-00.통계 입력현황 아이템 인터페이스 */ export interface StatsInputStatusReviewItem { chk: string; diff --git a/apps/st/src/entities/statistics/model/statistics-management-interface.ts b/apps/st/src/entities/statistics/model/statistics-management-interface.ts deleted file mode 100644 index b8078a186..000000000 --- a/apps/st/src/entities/statistics/model/statistics-management-interface.ts +++ /dev/null @@ -1,92 +0,0 @@ -import type { ApiResponse } from "./statistics-interface"; - -// 검토 하수도 보급률 데이터 항목 -export interface SewerageSupplyRateReviewItem { - - /* ====================================================================== - * 행 및 지역 기본 정보 - * ====================================================================== */ - sido: string; - gugun: string; - adstDong: string; - rgnNm: string; - displayYear: string; - rowType: 'OLD' | 'CURR'; - adstCd: string; - bsnmCd: string; - yr: number; - - /* ====================================================================== - * 수계 및 지역 정보 - * ====================================================================== */ - rvbsn: string; - lgbsn: string; - mdbsn: string; - mdmbsn: string; - wrssm: string | null; - bstrm: string; - speclCntrplnAr: string | null; - - /* ====================================================================== - * 인구 및 면적 데이터 (공통 필드명) - * ====================================================================== */ - popltnSm: number; // 총인구 - arSm: number; // 총면적(㎢) - - /* 하수처리구역내 (groupD) */ - swgeProcZoneInnerSm: number; // 계 - pblswrgPopltnSm: number; // 공공하수처리인구-합계 - pblswrgPrmTrt: number; // 1차처리 - pblswrgScdTrt: number; // 2차처리 - pblswrgTertTrt: number; // 3차처리 - - wstrPopltnSm: number; // 폐수처리인구-합계 - wstrPrmTrt: number; // 1차처리 - wstrScdTrt: number; // 2차처리 - wstrTertTrt: number; // 3차처리 - - notConectPopltn: number; // 미접속인구 - swgeProcZoneInnerAr: number; // 면적(㎢) - - /* 하수처리구역외 (groupE) */ - swgeProcZoneOuterSm: number; // 계 - townUnprocPopltn: number; // 미처리인구 (Town + Uptown 합산값) - townSwttPopltn: number; // 오수처리인구 (Town + Uptown 합산값) - townWrrtnPopltn: number; // 정화조인구 (Town + Uptown 합산값) - swgeProcZoneOuterAr: number; // 면적(㎢) - - /* ====================================================================== - * 보급률 및 기타 - * ====================================================================== */ - pblswrgPopltnSuprt: number; // 공공하수보급률(%) - adtrtPopltnSuprt: number; // 고도처리보급률(%) - swrgInstlrt: number; // 하수도설치율(%) - rmk: string | null; // 비고 - - /* ====================================================================== - * Flag (필요 시 유지) - * ====================================================================== */ - lcnt: number | null; - ocnt: number | null; - -} - -export interface SewerageSupplyRateReviewResponseData { - sewerageSupplyRateList: SewerageSupplyRateReviewItem[]; -} - -export type SewerageSupplyRateReviewApiResponse = ApiResponse & { - message: string; -}; - - -export interface SewerageSupplyRateReviewRequestParams { - sido?: string; - gugun?: string; - yr?: string; - bsnmCd?: string; -} - -export interface SewerageSupplyRateReviewService { - getSewerageSupplyRateReviewList(params: SewerageSupplyRateReviewRequestParams): Promise; -} \ No newline at end of file