23 lines
636 B
TypeScript
23 lines
636 B
TypeScript
import { client } from "@/shared/api";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
import type { IpService, IpParams, IpList, IP } from "../model/ip-interface";
|
|
|
|
export class IpApiService implements IpService {
|
|
public async getIpList(params: IpParams): Promise<IpList> {
|
|
const response = await client.get<IpList>(`${ENDPOINT.CMS_SERVICE.IPS}`, {
|
|
params,
|
|
});
|
|
return response.data;
|
|
}
|
|
|
|
public async saveIpList(body: IP[]): Promise<void> {
|
|
const response = await client.post<void>(
|
|
`${ENDPOINT.CMS_SERVICE.IPS}`,
|
|
body,
|
|
);
|
|
return response.data;
|
|
}
|
|
}
|
|
|
|
export const IpApi = new IpApiService();
|