Files
frontend/apps/st/src/entities/statistics/api/statistics-analysis-result-api.ts
T

77 lines
2.1 KiB
TypeScript

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<StAnlsRsltListApiResponse> {
const response = await client.get<StAnlsRsltListApiResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}`,
{
params,
},
);
return response.data;
}
public async getImrResultList(
anlsSn: number,
params: PageableParams,
): Promise<StAnlsRsltListApiResponse> {
const response = await client.get<StAnlsRsltListApiResponse>(
`${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}/imr/rsltlist/${anlsSn}`,
{
params,
},
);
return response.data;
}
public async getChartData(
anlsSn: number,
vrfcTrgtSn: number,
): Promise<ChartRetDto> {
const response = await client.get<ChartRetDto>(
`${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}/chartList/${anlsSn}/${vrfcTrgtSn}`,
);
return response.data;
}
public async downloadExcel(
anlsSn: number,
vrfcTrgtSn: number,
): Promise<Blob> {
const response = await client.get<Blob>(
`${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}/excel-down/${anlsSn}/${vrfcTrgtSn}`,
{
responseType: "blob",
},
);
return response.data;
}
public async downloadExcelImr(anlsSn: number): Promise<Blob> {
const response = await client.get<Blob>(
`${ENDPOINT.STATVERIFY_SERVICE.ST_ANLS_RSLT}/excel-down/imr/${anlsSn}`,
{
responseType: "blob",
},
);
return response.data;
}
}
export const stAnlsRsltApi = new StAnlsRsltApiService();