109 lines
3.7 KiB
TypeScript
109 lines
3.7 KiB
TypeScript
import { client } from "@/shared/api";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
|
|
import type {
|
|
VerificationTargetCodeResponse,
|
|
VerificationTargetManagementService,
|
|
VerificationTargetManagementSearchParams,
|
|
VerificationTargetManagementListApiResponse,
|
|
VerificationTargetManagementDetailApiResponse,
|
|
VerificationTargetManagementSaveRequest,
|
|
VerificationTargetManagementSaveApiResponse,
|
|
VerificationTargetManagementUpdateRequest,
|
|
VerificationTargetManagementUpdateApiResponse,
|
|
VerificationTargetManagementDeleteApiResponse,
|
|
} from "../model/verification-target-management-interface";
|
|
|
|
export class VerificationTargetManagementApiService implements VerificationTargetManagementService {
|
|
/**
|
|
* 검증 대상 목록 조회
|
|
* @param params 검색 조건 (vrfcMthdCd, statsCd, tblNm, colNm, vrfcTrgtNm, useYn, page, size, sort)
|
|
*/
|
|
public async getVerificationTargetManagementList(
|
|
params: VerificationTargetManagementSearchParams,
|
|
): Promise<VerificationTargetManagementListApiResponse> {
|
|
const response =
|
|
await client.get<VerificationTargetManagementListApiResponse>(
|
|
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}`,
|
|
{ params },
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
/**
|
|
* 검증 대상 상세 조회
|
|
* @param vrfcTrgtSn 검증 대상 일련번호
|
|
*/
|
|
public async getVerificationTargetManagementById(
|
|
vrfcTrgtSn: number,
|
|
): Promise<VerificationTargetManagementDetailApiResponse> {
|
|
const response =
|
|
await client.get<VerificationTargetManagementDetailApiResponse>(
|
|
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}/${vrfcTrgtSn}`,
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
/**
|
|
* 검증 대상 코드 목록 조회
|
|
*/
|
|
public async getVerificationTargetCodes(): Promise<
|
|
VerificationTargetCodeResponse[]
|
|
> {
|
|
const response = await client.get<VerificationTargetCodeResponse[]>(
|
|
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}/code`,
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
/**
|
|
* 검증 대상 등록
|
|
* @param request 등록 요청 데이터
|
|
*/
|
|
public async saveVerificationTargetManagement(
|
|
request: VerificationTargetManagementSaveRequest,
|
|
): Promise<VerificationTargetManagementSaveApiResponse> {
|
|
const response =
|
|
await client.post<VerificationTargetManagementSaveApiResponse>(
|
|
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}`,
|
|
request,
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
/**
|
|
* 검증 대상 수정
|
|
* @param vrfcTrgtSn 검증 대상 일련번호
|
|
* @param request 수정 요청 데이터
|
|
*/
|
|
public async updateVerificationTargetManagement(
|
|
vrfcTrgtSn: number,
|
|
request: VerificationTargetManagementUpdateRequest,
|
|
): Promise<VerificationTargetManagementUpdateApiResponse> {
|
|
const response =
|
|
await client.put<VerificationTargetManagementUpdateApiResponse>(
|
|
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}/${vrfcTrgtSn}`,
|
|
request,
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
/**
|
|
* 검증 대상 삭제
|
|
* @param vrfcTrgtSn 검증 대상 일련번호
|
|
*/
|
|
public async deleteVerificationTargetManagement(
|
|
vrfcTrgtSn: number,
|
|
): Promise<VerificationTargetManagementDeleteApiResponse> {
|
|
const response =
|
|
await client.delete<VerificationTargetManagementDeleteApiResponse>(
|
|
`${ENDPOINT.STATVERIFY_SERVICE.VRFCTGT_MNG}/${vrfcTrgtSn}`,
|
|
);
|
|
return response.data;
|
|
}
|
|
}
|
|
|
|
// 통합 인스턴스 수출
|
|
export const verificationTargetManagementApi =
|
|
new VerificationTargetManagementApiService();
|