import { client } from "@/shared/api"; import { ENDPOINT } from "@/shared/config"; import type { ClsfSystmParamsDto, ClsfSystmResponseDto, DcService, FileDownloadParamsDto, FileParamsDto, LvNowDmgMtncGnsvyResponseDto, LvNowDmgMtncGnsvySearchDto, NowDmgMtncGnsvyResponseDto, NowDmgMtncGnsvySearchDto, } from "../model/dc-interface"; async function getNowDmgMtncGnsvy( params: NowDmgMtncGnsvySearchDto, ): Promise { const response = await client.get( `${ENDPOINT.DC_SERVICE}/nowDmgMtncGnsvy`, { params }, ); return response.data; } async function getLvNowDmgMtncGnsvy( params: LvNowDmgMtncGnsvySearchDto, ): Promise { const response = await client.get( `${ENDPOINT.DC_SERVICE}/lvNowDmgMtncGnsvy`, { params }, ); return response.data; } async function getClsfSystm(params: ClsfSystmParamsDto): Promise { const response = await client.get(`${ENDPOINT.DC_SERVICE}/clsf`, { params, }); return response.data; } async function getFile(params: FileParamsDto): Promise { const response = await client.get(`${ENDPOINT.DC_SERVICE}/file`, { params, }); return response.data; } async function getFilePrcs(fileSn: string): Promise { const response = await client.get(`${ENDPOINT.DC_SERVICE}/fileprcs`, { params: { fileSn }, }); return response.data; } async function fileDownload(params: FileDownloadParamsDto): Promise { const response = await client.get(`${ENDPOINT.DC_SERVICE}/fileDownload`, { params, responseType: "blob", }); return response.data; } export const dcService = { getNowDmgMtncGnsvy, getLvNowDmgMtncGnsvy, getClsfSystm, getFile, getFilePrcs, fileDownload, } satisfies DcService;