34 lines
948 B
TypeScript
34 lines
948 B
TypeScript
import { client } from "@/shared/api";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
import {
|
|
type ConnectionLogParams,
|
|
type ConnectionLogList,
|
|
type ConnectionStatisticsParams,
|
|
type ConnectionStatistics,
|
|
type ConnectionLogService,
|
|
} from "../model/connection-log-interface";
|
|
|
|
class ConnectionLogApiService implements ConnectionLogService {
|
|
async getConnectionLog(
|
|
params: ConnectionLogParams,
|
|
): Promise<ConnectionLogList> {
|
|
const response = await client.get<ConnectionLogList>(
|
|
`${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}`,
|
|
{ params },
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
async getConnectionStatistics(
|
|
params: ConnectionStatisticsParams,
|
|
): Promise<ConnectionStatistics> {
|
|
const response = await client.get<ConnectionStatistics>(
|
|
`${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}/stat`,
|
|
{ params },
|
|
);
|
|
return response.data;
|
|
}
|
|
}
|
|
|
|
export const ConnectionLogApi = new ConnectionLogApiService();
|