42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { client } from "@/shared/api";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
import type { PageableList, PageableParams } from "@/shared/model";
|
|
|
|
export interface ZipSearchParams extends PageableParams {
|
|
zoneNo?: string; // 구역번호
|
|
ctpvNm?: string; // 시도명
|
|
sggNm?: string; // 시군구명
|
|
emdNm?: string; // 읍면동명
|
|
roadNm?: string; // 도로명
|
|
stdgNm?: string; // 법정동명
|
|
dongNm?: string; // 행정동명
|
|
lotnoMno?: number | null; // 지번본번
|
|
lotnoSno?: number | null; // 지번부번
|
|
}
|
|
|
|
export interface Zip {
|
|
zipId: number;
|
|
zoneNo: string;
|
|
ctpvNm: string;
|
|
sggNm: string;
|
|
emdNm: string;
|
|
roadNm: string;
|
|
lotnoMno: number;
|
|
lotnoSno: number;
|
|
lotno: string;
|
|
zipAddr: string;
|
|
}
|
|
|
|
type ZipList = PageableList<Zip>;
|
|
|
|
export class ZipApiService {
|
|
public async searchZip(params: ZipSearchParams): Promise<ZipList> {
|
|
const response = await client.get<ZipList>(`${ENDPOINT.CMS_SERVICE.ZIPS}`, {
|
|
params,
|
|
});
|
|
return response.data;
|
|
}
|
|
}
|
|
|
|
export const ZipApi = new ZipApiService();
|