[st] feat: IMR 서비스 추가
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
import { client } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
|
||||
import type {
|
||||
ImrDetailRequest,
|
||||
ImrDetailResponse,
|
||||
ImrDetectRequest,
|
||||
ImrDetectResponse,
|
||||
ImrListRequest,
|
||||
ImrListResponse,
|
||||
ImrLogRequest,
|
||||
ImrLogResponse,
|
||||
} from "../model/imr-interface";
|
||||
|
||||
export class ImrApiService {
|
||||
/**
|
||||
* 이상치 탐지 알고리즘 실행 요청
|
||||
*/
|
||||
public async detectOutliers(
|
||||
payload: ImrDetectRequest,
|
||||
): Promise<ImrDetectResponse> {
|
||||
const response = await client.post<ImrDetectResponse>(
|
||||
`${ENDPOINT.STATVERIFY_SERVICE.IMR}`,
|
||||
payload,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 이상치 탐지 마스터 목록 조회
|
||||
*/
|
||||
public async getOutliersList(
|
||||
payload: ImrListRequest,
|
||||
): Promise<ImrListResponse[]> {
|
||||
const response = await client.post<ImrListResponse[]>(
|
||||
`${ENDPOINT.STATVERIFY_SERVICE.IMR}/list`,
|
||||
payload,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 이상치 탐지 상세 조회
|
||||
*/
|
||||
public async getOutliersDetail(
|
||||
payload: ImrDetailRequest,
|
||||
): Promise<ImrDetailResponse> {
|
||||
const response = await client.post<ImrDetailResponse>(
|
||||
`${ENDPOINT.STATVERIFY_SERVICE.IMR}/list/detail`,
|
||||
payload,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 이상치 산출 로그 조회
|
||||
*/
|
||||
public async getOutliersLog(
|
||||
payload: ImrLogRequest,
|
||||
): Promise<ImrLogResponse> {
|
||||
const response = await client.post<ImrLogResponse>(
|
||||
`${ENDPOINT.STATVERIFY_SERVICE.IMR}/list/detail/log`,
|
||||
payload,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
export const imrApi = new ImrApiService();
|
||||
@@ -21,6 +21,20 @@ export class StAnlsRsltApiService {
|
||||
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,
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
export interface ImrDetectRequest {
|
||||
anlsSn: number;
|
||||
vrfcTrgtSn: number;
|
||||
statsYr: string;
|
||||
userId?: string;
|
||||
}
|
||||
|
||||
export interface ImrDetectResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
jobId?: string;
|
||||
}
|
||||
|
||||
export interface ImrListRequest {
|
||||
anlsSn?: number;
|
||||
vrfcTrgtSn?: number;
|
||||
statsYr?: string;
|
||||
}
|
||||
|
||||
export interface ImrListResponse {
|
||||
anlsSn: number;
|
||||
vrfcTrgtSn: number;
|
||||
statsYr: string;
|
||||
admdstCd: string;
|
||||
admdstNm: string;
|
||||
modelNm: string;
|
||||
anlsDt: string;
|
||||
}
|
||||
|
||||
export interface ImrDetailRequest {
|
||||
anlsSn: number;
|
||||
vrfcTrgtSn: number;
|
||||
admdstCd?: string;
|
||||
}
|
||||
|
||||
export interface ImrDetailResponse {
|
||||
anlsSn: number;
|
||||
vrfcTrgtSn: number;
|
||||
details: Array<{
|
||||
admdstCd: string;
|
||||
admdstNm: string;
|
||||
val: number;
|
||||
isOutlier: boolean;
|
||||
score: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface ImrLogRequest {
|
||||
anlsSn: number;
|
||||
vrfcTrgtSn: number;
|
||||
admdstCd: string;
|
||||
}
|
||||
|
||||
export interface ImrLogResponse {
|
||||
anlsSn: number;
|
||||
vrfcTrgtSn: number;
|
||||
admdstCd: string;
|
||||
logs: Array<{
|
||||
timestamp: string;
|
||||
level: string;
|
||||
message: string;
|
||||
}>;
|
||||
}
|
||||
@@ -79,6 +79,7 @@ export const ENDPOINT = {
|
||||
ST_ANLS_MST: "/statverify-service/api/v1/st-anls-mst",
|
||||
ST_ANLS_DTL: "/statverify-service/api/v1/st-anls-dtl",
|
||||
ST_ANLS_RSLT: "/statverify-service/api/v1/st-anls-rslt",
|
||||
IMR: "/statverify-service/api/v1/imr/outlier/detect",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user