이름: solution/front → solution/frontend
`backend` 옆에 `front` 가 있을 이유가 없었다. negosium 의 negodata/front 를 그대로 베꼈고 그게 왜 front 인지는 따져보지 않았다 — 근거 없이 들여온 이름이라 바로잡는다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019uYhHQdssRubirPirrdJJC
This commit is contained in:
1 parent
06f6438d9b
commit
c85c577349
480 files changed
+22
-22
No files matched your search
@@ -0,0 +1,484 @@
|
||||
/**
|
||||
* Generated by orval v7.21.0 🍺
|
||||
* Do not edit manually.
|
||||
* Web4Ai API
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import {
|
||||
useMutation,
|
||||
useQuery
|
||||
} from '@tanstack/react-query';
|
||||
import type {
|
||||
DataTag,
|
||||
DefinedInitialDataOptions,
|
||||
DefinedUseQueryResult,
|
||||
MutationFunction,
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
QueryKey,
|
||||
UndefinedInitialDataOptions,
|
||||
UseMutationOptions,
|
||||
UseMutationResult,
|
||||
UseQueryOptions,
|
||||
UseQueryResult
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
import type {
|
||||
GetWeatherParams,
|
||||
HTTPValidationError,
|
||||
ListContentsParams,
|
||||
ReqPublishLocalContent,
|
||||
ReqSyncFestivals,
|
||||
ReqUpdateLocalContent,
|
||||
ResLocalContentList,
|
||||
ResSyncFestivals,
|
||||
ResWeather
|
||||
} from '.././model';
|
||||
|
||||
import { customFetch } from '../../mutator/custom-fetch';
|
||||
|
||||
|
||||
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @summary List Contents
|
||||
*/
|
||||
export const listContents = (
|
||||
params?: ListContentsParams,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResLocalContentList>(
|
||||
{url: `/v1/admin/local-content`, method: 'GET',
|
||||
params, signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const getListContentsQueryKey = (params?: ListContentsParams,) => {
|
||||
return [
|
||||
`/v1/admin/local-content`, ...(params ? [params]: [])
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getListContentsQueryOptions = <TData = Awaited<ReturnType<typeof listContents>>, TError = HTTPValidationError>(params?: ListContentsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listContents>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getListContentsQueryKey(params);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof listContents>>> = ({ signal }) => listContents(params, requestOptions, signal);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof listContents>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type ListContentsQueryResult = NonNullable<Awaited<ReturnType<typeof listContents>>>
|
||||
export type ListContentsQueryError = HTTPValidationError
|
||||
|
||||
|
||||
export function useListContents<TData = Awaited<ReturnType<typeof listContents>>, TError = HTTPValidationError>(
|
||||
params: undefined | ListContentsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof listContents>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listContents>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listContents>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListContents<TData = Awaited<ReturnType<typeof listContents>>, TError = HTTPValidationError>(
|
||||
params?: ListContentsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listContents>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof listContents>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof listContents>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useListContents<TData = Awaited<ReturnType<typeof listContents>>, TError = HTTPValidationError>(
|
||||
params?: ListContentsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listContents>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary List Contents
|
||||
*/
|
||||
|
||||
export function useListContents<TData = Awaited<ReturnType<typeof listContents>>, TError = HTTPValidationError>(
|
||||
params?: ListContentsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof listContents>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getListContentsQueryOptions(params,options)
|
||||
|
||||
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
||||
|
||||
query.queryKey = queryOptions.queryKey ;
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @summary Sync Festivals
|
||||
*/
|
||||
export const syncFestivals = (
|
||||
reqSyncFestivals: ReqSyncFestivals,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResSyncFestivals>(
|
||||
{url: `/v1/admin/local-content/sync-festivals`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqSyncFestivals, signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getSyncFestivalsMutationOptions = <TError = HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof syncFestivals>>, TError,{data: ReqSyncFestivals}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof syncFestivals>>, TError,{data: ReqSyncFestivals}, TContext> => {
|
||||
|
||||
const mutationKey = ['syncFestivals'];
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof syncFestivals>>, {data: ReqSyncFestivals}> = (props) => {
|
||||
const {data} = props ?? {};
|
||||
|
||||
return syncFestivals(data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type SyncFestivalsMutationResult = NonNullable<Awaited<ReturnType<typeof syncFestivals>>>
|
||||
export type SyncFestivalsMutationBody = ReqSyncFestivals
|
||||
export type SyncFestivalsMutationError = HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary Sync Festivals
|
||||
*/
|
||||
export const useSyncFestivals = <TError = HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof syncFestivals>>, TError,{data: ReqSyncFestivals}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof syncFestivals>>,
|
||||
TError,
|
||||
{data: ReqSyncFestivals},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getSyncFestivalsMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary Publish
|
||||
*/
|
||||
export const publish = (
|
||||
reqPublishLocalContent: ReqPublishLocalContent,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResLocalContentList>(
|
||||
{url: `/v1/admin/local-content/publish`, method: 'POST',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqPublishLocalContent, signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getPublishMutationOptions = <TError = HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof publish>>, TError,{data: ReqPublishLocalContent}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof publish>>, TError,{data: ReqPublishLocalContent}, TContext> => {
|
||||
|
||||
const mutationKey = ['publish'];
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof publish>>, {data: ReqPublishLocalContent}> = (props) => {
|
||||
const {data} = props ?? {};
|
||||
|
||||
return publish(data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type PublishMutationResult = NonNullable<Awaited<ReturnType<typeof publish>>>
|
||||
export type PublishMutationBody = ReqPublishLocalContent
|
||||
export type PublishMutationError = HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary Publish
|
||||
*/
|
||||
export const usePublish = <TError = HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof publish>>, TError,{data: ReqPublishLocalContent}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof publish>>,
|
||||
TError,
|
||||
{data: ReqPublishLocalContent},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getPublishMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary Update Content
|
||||
*/
|
||||
export const updateContent = (
|
||||
contentId: string,
|
||||
reqUpdateLocalContent: ReqUpdateLocalContent,
|
||||
options?: SecondParameter<typeof customFetch>,) => {
|
||||
|
||||
|
||||
return customFetch<ResLocalContentList>(
|
||||
{url: `/v1/admin/local-content/${contentId}`, method: 'PATCH',
|
||||
headers: {'Content-Type': 'application/json', },
|
||||
data: reqUpdateLocalContent
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getUpdateContentMutationOptions = <TError = HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateContent>>, TError,{contentId: string;data: ReqUpdateLocalContent}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof updateContent>>, TError,{contentId: string;data: ReqUpdateLocalContent}, TContext> => {
|
||||
|
||||
const mutationKey = ['updateContent'];
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof updateContent>>, {contentId: string;data: ReqUpdateLocalContent}> = (props) => {
|
||||
const {contentId,data} = props ?? {};
|
||||
|
||||
return updateContent(contentId,data,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type UpdateContentMutationResult = NonNullable<Awaited<ReturnType<typeof updateContent>>>
|
||||
export type UpdateContentMutationBody = ReqUpdateLocalContent
|
||||
export type UpdateContentMutationError = HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary Update Content
|
||||
*/
|
||||
export const useUpdateContent = <TError = HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof updateContent>>, TError,{contentId: string;data: ReqUpdateLocalContent}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof updateContent>>,
|
||||
TError,
|
||||
{contentId: string;data: ReqUpdateLocalContent},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getUpdateContentMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary End Content
|
||||
*/
|
||||
export const endContent = (
|
||||
contentId: string,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResLocalContentList>(
|
||||
{url: `/v1/admin/local-content/${contentId}/end`, method: 'POST', signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export const getEndContentMutationOptions = <TError = HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof endContent>>, TError,{contentId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
): UseMutationOptions<Awaited<ReturnType<typeof endContent>>, TError,{contentId: string}, TContext> => {
|
||||
|
||||
const mutationKey = ['endContent'];
|
||||
const {mutation: mutationOptions, request: requestOptions} = options ?
|
||||
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
||||
options
|
||||
: {...options, mutation: {...options.mutation, mutationKey}}
|
||||
: {mutation: { mutationKey, }, request: undefined};
|
||||
|
||||
|
||||
|
||||
|
||||
const mutationFn: MutationFunction<Awaited<ReturnType<typeof endContent>>, {contentId: string}> = (props) => {
|
||||
const {contentId} = props ?? {};
|
||||
|
||||
return endContent(contentId,requestOptions)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return { mutationFn, ...mutationOptions }}
|
||||
|
||||
export type EndContentMutationResult = NonNullable<Awaited<ReturnType<typeof endContent>>>
|
||||
|
||||
export type EndContentMutationError = HTTPValidationError
|
||||
|
||||
/**
|
||||
* @summary End Content
|
||||
*/
|
||||
export const useEndContent = <TError = HTTPValidationError,
|
||||
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof endContent>>, TError,{contentId: string}, TContext>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient): UseMutationResult<
|
||||
Awaited<ReturnType<typeof endContent>>,
|
||||
TError,
|
||||
{contentId: string},
|
||||
TContext
|
||||
> => {
|
||||
|
||||
const mutationOptions = getEndContentMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
}
|
||||
/**
|
||||
* @summary 현재 날씨 조회 (cache-aside)
|
||||
*/
|
||||
export const getWeather = (
|
||||
params: GetWeatherParams,
|
||||
options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
|
||||
) => {
|
||||
|
||||
|
||||
return customFetch<ResWeather>(
|
||||
{url: `/v1/local/weather`, method: 'GET',
|
||||
params, signal
|
||||
},
|
||||
options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const getGetWeatherQueryKey = (params?: GetWeatherParams,) => {
|
||||
return [
|
||||
`/v1/local/weather`, ...(params ? [params]: [])
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
export const getGetWeatherQueryOptions = <TData = Awaited<ReturnType<typeof getWeather>>, TError = HTTPValidationError>(params: GetWeatherParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getWeather>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
) => {
|
||||
|
||||
const {query: queryOptions, request: requestOptions} = options ?? {};
|
||||
|
||||
const queryKey = queryOptions?.queryKey ?? getGetWeatherQueryKey(params);
|
||||
|
||||
|
||||
|
||||
const queryFn: QueryFunction<Awaited<ReturnType<typeof getWeather>>> = ({ signal }) => getWeather(params, requestOptions, signal);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getWeather>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
}
|
||||
|
||||
export type GetWeatherQueryResult = NonNullable<Awaited<ReturnType<typeof getWeather>>>
|
||||
export type GetWeatherQueryError = HTTPValidationError
|
||||
|
||||
|
||||
export function useGetWeather<TData = Awaited<ReturnType<typeof getWeather>>, TError = HTTPValidationError>(
|
||||
params: GetWeatherParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getWeather>>, TError, TData>> & Pick<
|
||||
DefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getWeather>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getWeather>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetWeather<TData = Awaited<ReturnType<typeof getWeather>>, TError = HTTPValidationError>(
|
||||
params: GetWeatherParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getWeather>>, TError, TData>> & Pick<
|
||||
UndefinedInitialDataOptions<
|
||||
Awaited<ReturnType<typeof getWeather>>,
|
||||
TError,
|
||||
Awaited<ReturnType<typeof getWeather>>
|
||||
> , 'initialData'
|
||||
>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
export function useGetWeather<TData = Awaited<ReturnType<typeof getWeather>>, TError = HTTPValidationError>(
|
||||
params: GetWeatherParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getWeather>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
||||
/**
|
||||
* @summary 현재 날씨 조회 (cache-aside)
|
||||
*/
|
||||
|
||||
export function useGetWeather<TData = Awaited<ReturnType<typeof getWeather>>, TError = HTTPValidationError>(
|
||||
params: GetWeatherParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getWeather>>, TError, TData>>, request?: SecondParameter<typeof customFetch>}
|
||||
, queryClient?: QueryClient
|
||||
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
||||
|
||||
const queryOptions = getGetWeatherQueryOptions(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