refactor: service 통합,인터페이스 네이밍 수정
This commit is contained in:
@@ -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<StatsInputStatusReviewApiResponse> {
|
||||
const response = await axios.get<StatsInputStatusReviewApiResponse>(
|
||||
|
||||
`${ENDPOINT.ST_SERVICE.REVIEW}/input-status`,
|
||||
{
|
||||
params: params
|
||||
}
|
||||
);
|
||||
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async checkInputPeriod(params: string | number): Promise<any> {
|
||||
const response = await axios.get<any>(
|
||||
`${ENDPOINT.ST_SERVICE.INPUTCOMMON}/check-input-period?year=${params}`
|
||||
);
|
||||
|
||||
return response.data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export const statsInputStatusReviewApi = new StatsInputStatusReviewApiService();
|
||||
@@ -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<StatsInputStatusReviewApiResponse> {
|
||||
const response = await axios.get<StatsInputStatusReviewApiResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.REVIEW}/input-status`,
|
||||
{ params }
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 입력 기간 확인 (공통)
|
||||
* @param year 연도
|
||||
*/
|
||||
public async checkInputPeriod(year: string | number): Promise<any> {
|
||||
const response = await axios.get<any>(
|
||||
`${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<SewerageSupplyRateReviewApiResponse> {
|
||||
const response = await axios.get<SewerageSupplyRateReviewApiResponse>(
|
||||
`${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<SewagePipeReviewApiResponse> {
|
||||
const response = await axios.get<SewagePipeReviewApiResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.REVIEW}/pipe/tab1`,
|
||||
{ params }
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
export const sewerageSupplyRateReviewApi = new SewerageSupplyRateReviewApiService();
|
||||
|
||||
// 통합 인스턴스 수출
|
||||
export const statisticsManagementApi = new StatisticsManagementApiService();
|
||||
@@ -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<SewagePipeReviewApiResponse> {
|
||||
const response = await axios.get<SewagePipeReviewApiResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.REVIEW}/pipe/tab1`,
|
||||
{
|
||||
params: params
|
||||
}
|
||||
);
|
||||
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
export const sewagePipeReviewApi = new SewagePipeReviewApiService();
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ApiResponse } from "./statistics-interface";
|
||||
|
||||
/**
|
||||
* 00.검토-통계 입력현황 아이템 인터페이스
|
||||
* 검토-00.통계 입력현황 아이템 인터페이스
|
||||
*/
|
||||
export interface StatsInputStatusReviewItem {
|
||||
chk: string;
|
||||
|
||||
@@ -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<SewerageSupplyRateReviewResponseData> & {
|
||||
message: string;
|
||||
};
|
||||
|
||||
|
||||
export interface SewerageSupplyRateReviewRequestParams {
|
||||
sido?: string;
|
||||
gugun?: string;
|
||||
yr?: string;
|
||||
bsnmCd?: string;
|
||||
}
|
||||
|
||||
export interface SewerageSupplyRateReviewService {
|
||||
getSewerageSupplyRateReviewList(params: SewerageSupplyRateReviewRequestParams): Promise<SewerageSupplyRateReviewApiResponse>;
|
||||
}
|
||||
Reference in New Issue
Block a user