[feat] solution/frontend: 사이트관리 크롤러 통계 — 전체 통계 탭과 사이트별 페이지, recharts 지연 로드
- 사이트관리에 "목록 / 전체 통계" 탭(?tab=stats)과 각 행의 "통계" 버튼(/ops/sites/:placeId/stats) - 크롤링 화면: 요약 카드 → 일별 누적 막대(용도 4분류+기타) → 봇별 → (전체) 사이트 순위·robots/sitemap· 기타 UA, (사이트별) 많이 읽힌 페이지·최근 50건. 기간 7/30/90일 - recharts 는 CrawlerDailyChart 한 파일에만 두고 lazy() 로 부른다 — 빌드 확인: 그 청크에만 있고 사장님 화면의 첫 로딩 스크립트에는 없다 - OpsSitesPage 는 기존 목록 코드를 다시 들여쓰지 않으려고, stats 탭이면 앞에서 바로 return 하고 탭 UI 는 SitesTabs 로 분리했다(+29/-3) - orval 로 API 클라이언트 재생성 — 줄바꿈(LF/CRLF)만 바뀐 생성 파일 약 90개는 되돌리고 실제 변경분만 담았다 lint(typegen·tsc·eslint)·build 통과. 화면 레이아웃·차트는 브라우저로 직접 보지 못했다(확장 미연결) — nginx 경유 API 호출과 SPA 라우트 200 까지만 확인.
This commit is contained in:
1 parent
d9c9952230
commit
cae3de5586
33 files changed
+1470
-75
No files matched your search
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { CrawlerBotRowBot } from "./crawlerBotRowBot";
|
||||
import type { CrawlerBotRowVendor } from "./crawlerBotRowVendor";
|
||||
|
||||
export interface CrawlerBotRow {
|
||||
bot?: CrawlerBotRowBot;
|
||||
vendor?: CrawlerBotRowVendor;
|
||||
purpose: string;
|
||||
hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerBotRowBot = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerBotRowVendor = string | null;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface CrawlerDaily {
|
||||
day: string;
|
||||
purpose: string;
|
||||
hits: number;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { CrawlerHitRowBot } from "./crawlerHitRowBot";
|
||||
import type { CrawlerHitRowVendor } from "./crawlerHitRowVendor";
|
||||
|
||||
export interface CrawlerHitRow {
|
||||
created_at: string;
|
||||
kind: string;
|
||||
bot?: CrawlerHitRowBot;
|
||||
vendor?: CrawlerHitRowVendor;
|
||||
purpose: string;
|
||||
path: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerHitRowBot = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerHitRowVendor = string | null;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface CrawlerPathRow {
|
||||
path: string;
|
||||
hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { CrawlerRootRowBot } from "./crawlerRootRowBot";
|
||||
|
||||
export interface CrawlerRootRow {
|
||||
kind: string;
|
||||
bot?: CrawlerRootRowBot;
|
||||
purpose: string;
|
||||
hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerRootRowBot = string | null;
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface CrawlerSiteRow {
|
||||
site_id: string;
|
||||
place_id: string;
|
||||
name: string;
|
||||
hits: number;
|
||||
ai_hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerStatsParams = {
|
||||
/**
|
||||
* KST 날짜, 기본 to-6일
|
||||
*/
|
||||
from?: string | null;
|
||||
/**
|
||||
* KST 날짜, 기본 오늘
|
||||
*/
|
||||
to?: string | null;
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { CrawlerSummaryLastAt } from "./crawlerSummaryLastAt";
|
||||
|
||||
export interface CrawlerSummary {
|
||||
total?: number;
|
||||
ai?: number;
|
||||
bots?: number;
|
||||
last_at?: CrawlerSummaryLastAt;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type CrawlerSummaryLastAt = string | null;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export interface CrawlerUaRow {
|
||||
user_agent: string;
|
||||
hits: number;
|
||||
last_at: string;
|
||||
}
|
||||
@@ -14,6 +14,21 @@ export * from "./buildStatus";
|
||||
export * from "./checkSlugParams";
|
||||
export * from "./confirm";
|
||||
export * from "./confirmArgs";
|
||||
export * from "./crawlerBotRow";
|
||||
export * from "./crawlerBotRowBot";
|
||||
export * from "./crawlerBotRowVendor";
|
||||
export * from "./crawlerDaily";
|
||||
export * from "./crawlerHitRow";
|
||||
export * from "./crawlerHitRowBot";
|
||||
export * from "./crawlerHitRowVendor";
|
||||
export * from "./crawlerPathRow";
|
||||
export * from "./crawlerRootRow";
|
||||
export * from "./crawlerRootRowBot";
|
||||
export * from "./crawlerSiteRow";
|
||||
export * from "./crawlerStatsParams";
|
||||
export * from "./crawlerSummary";
|
||||
export * from "./crawlerSummaryLastAt";
|
||||
export * from "./crawlerUaRow";
|
||||
export * from "./decision";
|
||||
export * from "./editRedirectParams";
|
||||
export * from "./errorInfo";
|
||||
@@ -258,6 +273,10 @@ export * from "./resCategorySchema";
|
||||
export * from "./resCategorySchemaCategory";
|
||||
export * from "./resCategorySchemaLabel";
|
||||
export * from "./resCategorySchemaMsg";
|
||||
export * from "./resCrawlerStats";
|
||||
export * from "./resCrawlerStatsDateFrom";
|
||||
export * from "./resCrawlerStatsDateTo";
|
||||
export * from "./resCrawlerStatsMsg";
|
||||
export * from "./resExtractFacts";
|
||||
export * from "./resExtractFactsMsg";
|
||||
export * from "./resExtractedFact";
|
||||
@@ -391,6 +410,7 @@ export * from "./searchPlacesPublicParams";
|
||||
export * from "./showcaseItem";
|
||||
export * from "./showcaseItemRegion";
|
||||
export * from "./showcaseItemThumbnailUrl";
|
||||
export * from "./siteCrawlerStatsParams";
|
||||
export * from "./siteData";
|
||||
export * from "./siteDataCurrentVersionId";
|
||||
export * from "./siteDataDomain";
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { ErrorInfo } from "./errorInfo";
|
||||
import type { ResCrawlerStatsMsg } from "./resCrawlerStatsMsg";
|
||||
import type { ResCrawlerStatsDateFrom } from "./resCrawlerStatsDateFrom";
|
||||
import type { ResCrawlerStatsDateTo } from "./resCrawlerStatsDateTo";
|
||||
import type { CrawlerSummary } from "./crawlerSummary";
|
||||
import type { CrawlerDaily } from "./crawlerDaily";
|
||||
import type { CrawlerBotRow } from "./crawlerBotRow";
|
||||
import type { CrawlerSiteRow } from "./crawlerSiteRow";
|
||||
import type { CrawlerRootRow } from "./crawlerRootRow";
|
||||
import type { CrawlerUaRow } from "./crawlerUaRow";
|
||||
import type { CrawlerPathRow } from "./crawlerPathRow";
|
||||
import type { CrawlerHitRow } from "./crawlerHitRow";
|
||||
|
||||
/**
|
||||
* 전체(sites·root_files·others)와 사이트별(pages·recent)이 같은 모델을 쓴다 — 해당 없는 칸은 비어 있다.
|
||||
*/
|
||||
export interface ResCrawlerStats {
|
||||
result?: ErrorInfo;
|
||||
msg?: ResCrawlerStatsMsg;
|
||||
date_from?: ResCrawlerStatsDateFrom;
|
||||
date_to?: ResCrawlerStatsDateTo;
|
||||
summary?: CrawlerSummary;
|
||||
daily?: CrawlerDaily[];
|
||||
bots?: CrawlerBotRow[];
|
||||
sites?: CrawlerSiteRow[];
|
||||
root_files?: CrawlerRootRow[];
|
||||
others?: CrawlerUaRow[];
|
||||
pages?: CrawlerPathRow[];
|
||||
recent?: CrawlerHitRow[];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResCrawlerStatsDateFrom = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResCrawlerStatsDateTo = string | null;
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type ResCrawlerStatsMsg = string | null;
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type SiteCrawlerStatsParams = {
|
||||
/**
|
||||
* KST 날짜, 기본 to-6일
|
||||
*/
|
||||
from?: string | null;
|
||||
/**
|
||||
* KST 날짜, 기본 오늘
|
||||
*/
|
||||
to?: string | null;
|
||||
};
|
||||
@@ -18,11 +18,14 @@ import type {
|
||||
} from "@tanstack/react-query";
|
||||
|
||||
import type {
|
||||
CrawlerStatsParams,
|
||||
HTTPValidationError,
|
||||
ListSitesParams,
|
||||
ListUsersParams,
|
||||
ResCrawlerStats,
|
||||
ResOpsSites,
|
||||
ResOpsUsers,
|
||||
SiteCrawlerStatsParams,
|
||||
} from ".././model";
|
||||
|
||||
import { customFetch } from "../../mutator/custom-fetch";
|
||||
@@ -312,3 +315,334 @@ export function useListUsers<
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 전체 크롤러 통계(개발자 전용)
|
||||
*/
|
||||
export const crawlerStats = (
|
||||
params?: CrawlerStatsParams,
|
||||
options?: SecondParameter<typeof customFetch>,
|
||||
signal?: AbortSignal,
|
||||
) => {
|
||||
return customFetch<ResCrawlerStats>(
|
||||
{ url: `/v1/ops/stats/crawlers`, method: "GET", params, signal },
|
||||
options,
|
||||
);
|
||||
};
|
||||
|
||||
export const getCrawlerStatsQueryKey = (params?: CrawlerStatsParams) => {
|
||||
return [`/v1/ops/stats/crawlers`, ...(params ? [params] : [])] as const;
|
||||
};
|
||||
|
||||
export const getCrawlerStatsQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: CrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getCrawlerStatsQueryKey(params);
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof crawlerStats>>> = ({
|
||||
signal,
|
||||
}) => crawlerStats(params, requestOptions, signal);
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type CrawlerStatsQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof crawlerStats>>
|
||||
>;
|
||||
export type CrawlerStatsQueryError = HTTPValidationError;
|
||||
|
||||
export function useCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params: undefined | CrawlerStatsParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof crawlerStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: CrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof crawlerStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: CrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary 전체 크롤러 통계(개발자 전용)
|
||||
*/
|
||||
|
||||
export function useCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof crawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
params?: CrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<Awaited<ReturnType<typeof crawlerStats>>, TError, TData>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getCrawlerStatsQueryOptions(params, options);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary 사이트별 크롤러 통계(개발자 전용)
|
||||
*/
|
||||
export const siteCrawlerStats = (
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: SecondParameter<typeof customFetch>,
|
||||
signal?: AbortSignal,
|
||||
) => {
|
||||
return customFetch<ResCrawlerStats>(
|
||||
{
|
||||
url: `/v1/ops/sites/${placeId}/stats/crawlers`,
|
||||
method: "GET",
|
||||
params,
|
||||
signal,
|
||||
},
|
||||
options,
|
||||
);
|
||||
};
|
||||
|
||||
export const getSiteCrawlerStatsQueryKey = (
|
||||
placeId?: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
) => {
|
||||
return [
|
||||
`/v1/ops/sites/${placeId}/stats/crawlers`,
|
||||
...(params ? [params] : []),
|
||||
] as const;
|
||||
};
|
||||
|
||||
export const getSiteCrawlerStatsQueryOptions = <
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
) => {
|
||||
const { query: queryOptions, request: requestOptions } = options ?? {};
|
||||
|
||||
const queryKey =
|
||||
queryOptions?.queryKey ?? getSiteCrawlerStatsQueryKey(placeId, params);
|
||||
|
||||
const queryFn: QueryFunction<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>
|
||||
> = ({ signal }) => siteCrawlerStats(placeId, params, requestOptions, signal);
|
||||
|
||||
return {
|
||||
queryKey,
|
||||
queryFn,
|
||||
enabled: !!placeId,
|
||||
...queryOptions,
|
||||
} as UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
};
|
||||
|
||||
export type SiteCrawlerStatsQueryResult = NonNullable<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>
|
||||
>;
|
||||
export type SiteCrawlerStatsQueryError = HTTPValidationError;
|
||||
|
||||
export function useSiteCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params: undefined | SiteCrawlerStatsParams,
|
||||
options: {
|
||||
query: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): DefinedUseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useSiteCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
> &
|
||||
Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>
|
||||
>,
|
||||
"initialData"
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
export function useSiteCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
};
|
||||
/**
|
||||
* @summary 사이트별 크롤러 통계(개발자 전용)
|
||||
*/
|
||||
|
||||
export function useSiteCrawlerStats<
|
||||
TData = Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError = HTTPValidationError,
|
||||
>(
|
||||
placeId: string,
|
||||
params?: SiteCrawlerStatsParams,
|
||||
options?: {
|
||||
query?: Partial<
|
||||
UseQueryOptions<
|
||||
Awaited<ReturnType<typeof siteCrawlerStats>>,
|
||||
TError,
|
||||
TData
|
||||
>
|
||||
>;
|
||||
request?: SecondParameter<typeof customFetch>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseQueryResult<TData, TError> & {
|
||||
queryKey: DataTag<QueryKey, TData, TError>;
|
||||
} {
|
||||
const queryOptions = getSiteCrawlerStatsQueryOptions(
|
||||
placeId,
|
||||
params,
|
||||
options,
|
||||
);
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<
|
||||
TData,
|
||||
TError
|
||||
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey;
|
||||
|
||||
return query;
|
||||
}
|
||||
Reference in new issue
Block a user