feat: 관리자 접속 IP 관리 기능 작업
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import { client } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import type {
|
||||
ManagerIp,
|
||||
ManagerIpInfo,
|
||||
ManagerIpList,
|
||||
ManagerIpParams,
|
||||
ManagerIpService,
|
||||
} from "../model/manager-ip-interface";
|
||||
|
||||
export class ManagerIpApiService implements ManagerIpService {
|
||||
public async getManagerIpList(
|
||||
params: ManagerIpParams,
|
||||
): Promise<ManagerIpList> {
|
||||
const response = await client.get<ManagerIpList>(
|
||||
`${ENDPOINT.CMS_SERVICE.MANAGER_IP}`,
|
||||
{ params },
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async getManagerIpInfo(mngNo: string): Promise<ManagerIpInfo> {
|
||||
const response = await client.get<ManagerIpInfo>(
|
||||
`${ENDPOINT.CMS_SERVICE.MANAGER_IP}/${mngNo}`,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async saveManagerIp(data: ManagerIp[]): Promise<void> {
|
||||
const response = await client.post<void>(
|
||||
ENDPOINT.CMS_SERVICE.MANAGER_IP,
|
||||
data,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async updateManagerIp(mngNo: string, data: ManagerIp): Promise<void> {
|
||||
const response = await client.put<void>(
|
||||
`${ENDPOINT.CMS_SERVICE.MANAGER_IP}/${mngNo}`,
|
||||
data,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async deleteManagerIp(mngNo: string): Promise<void> {
|
||||
await client.delete(`${ENDPOINT.CMS_SERVICE.MANAGER_IP}/${mngNo}`);
|
||||
}
|
||||
}
|
||||
|
||||
export const ManagerIpApi = new ManagerIpApiService();
|
||||
Reference in New Issue
Block a user