[as] WIP: 하수도기본계획 신청 페이지(이전기본계획조회)
This commit is contained in:
@@ -2,6 +2,11 @@ import { client } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
|
||||
import type {
|
||||
ClsfSystmRequestDto,
|
||||
ClsfSystmResponseDto,
|
||||
DcService,
|
||||
LvNowDmgMtncGnsvyResponseDto,
|
||||
LvNowDmgMtncGnsvySearchDto,
|
||||
NowDmgMtncGnsvyResponseDto,
|
||||
NowDmgMtncGnsvySearchDto,
|
||||
} from "../model/dc-interface";
|
||||
@@ -10,10 +15,31 @@ async function getNowDmgMtncGnsvy(
|
||||
params: NowDmgMtncGnsvySearchDto,
|
||||
): Promise<NowDmgMtncGnsvyResponseDto[]> {
|
||||
const response = await client.get<NowDmgMtncGnsvyResponseDto[]>(
|
||||
ENDPOINT.DC_SERVICE.NOW_DMG_MTNC_GNSVY,
|
||||
`${ENDPOINT.DC_SERVICE}/nowDmgMtncGnsvy`,
|
||||
{ params },
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export { getNowDmgMtncGnsvy };
|
||||
async function getLvNowDmgMtncGnsvy(
|
||||
params: LvNowDmgMtncGnsvySearchDto,
|
||||
): Promise<LvNowDmgMtncGnsvyResponseDto[]> {
|
||||
const response = await client.get<LvNowDmgMtncGnsvyResponseDto[]>(
|
||||
`${ENDPOINT.DC_SERVICE}/lvNowDmgMtncGnsvy`,
|
||||
{ params },
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async function getClsfSystm(params: ClsfSystmRequestDto): Promise<ClsfSystmResponseDto[]> {
|
||||
const response = await client.get<ClsfSystmResponseDto[]>(`${ENDPOINT.DC_SERVICE}/clsfSystm`, {
|
||||
params,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export const dcService = {
|
||||
getNowDmgMtncGnsvy,
|
||||
getLvNowDmgMtncGnsvy,
|
||||
getClsfSystm,
|
||||
} satisfies DcService;
|
||||
|
||||
@@ -2,16 +2,35 @@ import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
|
||||
import type { NowDmgMtncGnsvySearchDto } from "../model/dc-interface";
|
||||
import type {
|
||||
ClsfSystmRequestDto,
|
||||
LvNowDmgMtncGnsvySearchDto,
|
||||
NowDmgMtncGnsvySearchDto,
|
||||
} from "../model/dc-interface";
|
||||
|
||||
import { getNowDmgMtncGnsvy } from "./dc-service";
|
||||
import { dcService } from "./dc-service";
|
||||
|
||||
export const nowDmgMtncGnsvyBaseKey = [ENDPOINT.DC_SERVICE.NOW_DMG_MTNC_GNSVY] as const;
|
||||
export const baseKey = [ENDPOINT.DC_SERVICE] as const;
|
||||
|
||||
export function useNowDmgMtncGnsvy(params: NowDmgMtncGnsvySearchDto) {
|
||||
return useQuery({
|
||||
queryKey: [...nowDmgMtncGnsvyBaseKey, params],
|
||||
queryFn: () => getNowDmgMtncGnsvy(params),
|
||||
queryKey: [...baseKey, "nowDmgMtncGnsvy", params],
|
||||
queryFn: () => dcService.getNowDmgMtncGnsvy(params),
|
||||
enabled: Boolean(params.swtrmtFcltCd && params.ctpvNm),
|
||||
});
|
||||
}
|
||||
|
||||
export function useLvNowDmgMtncGnsvy(params: LvNowDmgMtncGnsvySearchDto) {
|
||||
return useQuery({
|
||||
queryKey: [...baseKey, "lvNowDmgMtncGnsvy", params],
|
||||
queryFn: () => dcService.getLvNowDmgMtncGnsvy(params),
|
||||
enabled: Boolean(params.level && params.ctpvNm && params.sggNm && params.gnsvyYr),
|
||||
});
|
||||
}
|
||||
|
||||
export function useClsfSystm(params: ClsfSystmRequestDto) {
|
||||
return useQuery({
|
||||
queryKey: [...baseKey, "clsfSystm", params],
|
||||
queryFn: () => dcService.getClsfSystm(params),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
export { getNowDmgMtncGnsvy } from "./api/dc-service";
|
||||
export { nowDmgMtncGnsvyBaseKey, useNowDmgMtncGnsvy } from "./api/queries";
|
||||
export type {
|
||||
NowDmgMtncGnsvyResponseDto,
|
||||
NowDmgMtncGnsvySearchDto,
|
||||
} from "./model/dc-interface";
|
||||
export { dcService } from "./api/dc-service";
|
||||
export { baseKey as nowDmgMtncGnsvyBaseKey, useNowDmgMtncGnsvy } from "./api/queries";
|
||||
export type { NowDmgMtncGnsvyResponseDto, NowDmgMtncGnsvySearchDto } from "./model/dc-interface";
|
||||
|
||||
@@ -5,6 +5,18 @@ export interface NowDmgMtncGnsvySearchDto {
|
||||
targetYear?: string;
|
||||
}
|
||||
|
||||
export interface LvNowDmgMtncGnsvySearchDto {
|
||||
level?: string;
|
||||
ctpvNm?: string;
|
||||
sggNm?: string;
|
||||
gnsvyYr?: string;
|
||||
}
|
||||
|
||||
export interface ClsfSystmRequestDto {
|
||||
clsfSystmNm?: string;
|
||||
upClsfSystmSn?: string;
|
||||
}
|
||||
|
||||
type NullableNumber = number | null;
|
||||
type NullableString = string | null;
|
||||
|
||||
@@ -46,7 +58,6 @@ type StagedMetricFields = {
|
||||
[K in keyof NowDmgMtncGnsvyMetricFields as `${K & string}${StageSuffix}`]?: NowDmgMtncGnsvyMetricFields[K];
|
||||
};
|
||||
|
||||
/** DC nowDmgMtncGnsvy 응답 DTO */
|
||||
export interface NowDmgMtncGnsvyResponseDto
|
||||
extends NowDmgMtncGnsvyMetricFields, StagedMetricFields {
|
||||
swtrmtFcltCd?: NullableString;
|
||||
@@ -55,3 +66,28 @@ export interface NowDmgMtncGnsvyResponseDto
|
||||
ctpvNm?: NullableString;
|
||||
sggNm?: NullableString;
|
||||
}
|
||||
|
||||
export interface LvNowDmgMtncGnsvyResponseDto {
|
||||
level: number;
|
||||
ctpvNm: string;
|
||||
sggNm: string;
|
||||
gnsvyYr: string;
|
||||
swtrmtFcltCd: string;
|
||||
swtrmtFcltNm: string;
|
||||
children: LvNowDmgMtncGnsvyResponseDto[];
|
||||
}
|
||||
|
||||
export interface ClsfSystmResponseDto {
|
||||
clsfSystmSn: string;
|
||||
upClsfSystmSn: string;
|
||||
clsfSystmNm: string;
|
||||
sortSeq: string;
|
||||
droppAble: boolean;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface DcService {
|
||||
getNowDmgMtncGnsvy(params: NowDmgMtncGnsvySearchDto): Promise<NowDmgMtncGnsvyResponseDto[]>;
|
||||
getLvNowDmgMtncGnsvy(params: LvNowDmgMtncGnsvySearchDto): Promise<LvNowDmgMtncGnsvyResponseDto[]>;
|
||||
getClsfSystm(params: ClsfSystmRequestDto): Promise<ClsfSystmResponseDto[]>;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import type { PageResponse } from "@/shared/model";
|
||||
|
||||
import type {
|
||||
SewerBscPlanApplySaveRequestDto,
|
||||
SewerBscPlanApplySaveResponseDto,
|
||||
SewerBscPlanDetResponseDto,
|
||||
SewerBscPlanResponseDto,
|
||||
SewerBscPlanSaveRequestDto,
|
||||
@@ -45,8 +46,10 @@ async function deleteFn(sewerBscPlanDocNo: string): Promise<void> {
|
||||
await client.delete<void>(`${BASE}/${sewerBscPlanDocNo}`);
|
||||
}
|
||||
|
||||
async function saveApply(body: SewerBscPlanApplySaveRequestDto): Promise<string> {
|
||||
const response = await client.post<string>(`${BASE}/save-apply`, body);
|
||||
async function saveApply(
|
||||
body: SewerBscPlanApplySaveRequestDto,
|
||||
): Promise<SewerBscPlanApplySaveResponseDto> {
|
||||
const response = await client.post<SewerBscPlanApplySaveResponseDto>(`${BASE}/save-apply`, body);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ export type {
|
||||
EsntlAtchFileItem,
|
||||
EsntlAtchFileMngTreeResponseDto,
|
||||
SewerBscPlanApplySaveRequestDto,
|
||||
SewerBscPlanApplySaveResponseDto,
|
||||
SewerBscPlanBizCstItem,
|
||||
SewerBscPlanBizCstResponseDto,
|
||||
SewerBscPlanDetResponseDto,
|
||||
|
||||
@@ -307,6 +307,12 @@ export interface SewerBscPlanApplySaveRequestDto extends PbadmsApplySaveHeader {
|
||||
tmplntTmprStrgList?: SewerBscPlanTmplntTmprStrgItem[];
|
||||
}
|
||||
|
||||
/** 백엔드 SewerBscPlanApplySaveResponseDto */
|
||||
export interface SewerBscPlanApplySaveResponseDto {
|
||||
sewerBscPlanDocNo: string;
|
||||
chgCycl: number;
|
||||
}
|
||||
|
||||
/** 백엔드 SewerBscPlanDetResponseDto */
|
||||
export interface SewerBscPlanDetResponseDto {
|
||||
detDto?: SewerBscPlanResponseDto;
|
||||
@@ -333,7 +339,7 @@ export interface SewerBscPlanService {
|
||||
body: SewerBscPlanUpdateRequestDto,
|
||||
): Promise<SewerBscPlanResponseDto>;
|
||||
delete(sewerBscPlanDocNo: string): Promise<void>;
|
||||
saveApply(body: SewerBscPlanApplySaveRequestDto): Promise<string>;
|
||||
saveApply(body: SewerBscPlanApplySaveRequestDto): Promise<SewerBscPlanApplySaveResponseDto>;
|
||||
findDetails(sewerBscPlanDocNo: string, chgCycl: number): Promise<SewerBscPlanDetResponseDto>;
|
||||
submitSupplement(id: string, body: SewerBscPlanApplySaveRequestDto): Promise<string>;
|
||||
submitReqSupplement(
|
||||
|
||||
Reference in New Issue
Block a user