28 lines
806 B
TypeScript
28 lines
806 B
TypeScript
import { client } from "@/shared/api";
|
|
import { ENDPOINT } from "@/shared/config";
|
|
import {
|
|
type BoardStatisticsParams,
|
|
type BoardStatistics,
|
|
type BoardStatisticsService,
|
|
} from "../model/board-statistics-interface";
|
|
|
|
class BoardStatisticsApiService implements BoardStatisticsService {
|
|
async getBoardStatistics(
|
|
params: BoardStatisticsParams,
|
|
): Promise<BoardStatistics> {
|
|
try {
|
|
// 실제 API 연동 시 아래 코드 사용
|
|
const response = await client.get<BoardStatistics>(
|
|
`${ENDPOINT.BOARD_SERVICE.STATISTICS}`,
|
|
{ params },
|
|
);
|
|
return response.data;
|
|
} catch (error) {
|
|
console.error("게시판 통계 데이터 조회 실패:", error);
|
|
throw error;
|
|
}
|
|
}
|
|
}
|
|
|
|
export const BoardStatisticsApi = new BoardStatisticsApiService();
|