66 lines
1.7 KiB
TypeScript
66 lines
1.7 KiB
TypeScript
import { client } from "@/shared/api";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
|
|
import type {
|
|
ChartRetDto,
|
|
StAnlsRsltListApiResponse,
|
|
StAnlsRsltSearchParams,
|
|
} from "../model/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: { page?: number; size?: number },
|
|
): 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;
|
|
}
|
|
}
|
|
|
|
export const stAnlsRsltApi = new StAnlsRsltApiService();
|
|
|