import { client } from "@/shared/api"; import { ENDPOINT } from "@/shared/config"; import type { PageableParams } from "@/shared/model"; import type { ChartRetDto, StAnlsRsltListApiResponse, StAnlsRsltSearchParams, } from "../model/statistics-analysis/statistics-analysis-result-interface"; export class StAnlsRsltApiService { public async getResultList( params: StAnlsRsltSearchParams, ): Promise { const response = await client.get( `${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}`, { params, }, ); return response.data; } public async getImrResultList( anlsSn: number, params: PageableParams, ): Promise { const response = await client.get( `${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}/imr/rsltlist/${anlsSn}`, { params, }, ); return response.data; } public async getChartData( anlsSn: number, vrfcTrgtSn: number, ): Promise { const response = await client.get( `${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}/chartList/${anlsSn}/${vrfcTrgtSn}`, ); return response.data; } public async downloadExcel( anlsSn: number, vrfcTrgtSn: number, ): Promise { const response = await client.get( `${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}/excel-down/${anlsSn}/${vrfcTrgtSn}`, { responseType: "blob", }, ); return response.data; } public async downloadExcelImr(anlsSn: number): Promise { const response = await client.get( `${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}/excel-down/imr/${anlsSn}`, { responseType: "blob", }, ); return response.data; } } export const stAnlsRsltApi = new StAnlsRsltApiService();