[apps/cs] refactor: 접속 로그 도메인 엔티티로 분리
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { client } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import {
|
||||
type ConnectionLogParams,
|
||||
type ConnectionStatisticsParams,
|
||||
type ConnectionStatistics,
|
||||
type ConnectionLogService,
|
||||
type ConnectionLogPageList,
|
||||
type ConnectionLogPayload,
|
||||
type ConnectionLog,
|
||||
} from "../model/connection-log-interface";
|
||||
|
||||
class ConnectionLogApiService implements ConnectionLogService {
|
||||
async getConnectionLogPage(
|
||||
params: ConnectionLogParams,
|
||||
): Promise<ConnectionLogPageList> {
|
||||
const response = await client.get<ConnectionLogPageList>(
|
||||
`${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;
|
||||
}
|
||||
|
||||
async saveConnectionLog(
|
||||
payload: ConnectionLogPayload,
|
||||
): Promise<ConnectionLog> {
|
||||
const response = await client.post<ConnectionLog>(
|
||||
`${ENDPOINT.CMS_SERVICE.CONNECTION_LOG}`,
|
||||
payload,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
export const ConnectionLogApi = new ConnectionLogApiService();
|
||||
Reference in New Issue
Block a user