feat:05/14 UI/기능 변경건 커밋

This commit is contained in:
minaChoi committed 2026-05-14 17:06:33 +09:00
1 parent 49367756ea
commit 327a50bd41
69 files changed
+1175 -1029

No files matched your search

+5
View File
@@ -8,6 +8,8 @@
*/
import ky, { type KyInstance } from 'ky'
const API_KEY = import.meta.env.VITE_API_KEY as string | undefined;
export const kyInstance: KyInstance = ky.create({
timeout: 10_000,
retry: 1,
@@ -15,6 +17,9 @@ export const kyInstance: KyInstance = ky.create({
throwHttpErrors: false,
hooks: {
beforeRequest: [
(request) => {
if (API_KEY) request.headers.set('x-api-key', API_KEY);
},
// TODO: 인증 토큰 주입
// request => {
// const token = localStorage.getItem('token')
@@ -1,120 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import {
useMutation
} from '@tanstack/react-query';
import type {
MutationFunction,
QueryClient,
UseMutationOptions,
UseMutationResult
} from '@tanstack/react-query';
import type {
ChannelVerifyRequest,
ChannelVerifyResponse,
HTTPValidationError
} from '../../model';
import { customFetcher } from '../../api';
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
/**
* @summary Verify Channels
*/
export type verifyChannelsResponse200 = {
data: ChannelVerifyResponse
status: 200
}
export type verifyChannelsResponse422 = {
data: HTTPValidationError
status: 422
}
export type verifyChannelsResponseSuccess = (verifyChannelsResponse200) & {
headers: Headers;
};
export type verifyChannelsResponseError = (verifyChannelsResponse422) & {
headers: Headers;
};
export type verifyChannelsResponse = (verifyChannelsResponseSuccess | verifyChannelsResponseError)
export const getVerifyChannelsUrl = () => {
return `/api/channels/verify`
}
export const verifyChannels = async (channelVerifyRequest: ChannelVerifyRequest, options?: RequestInit): Promise<verifyChannelsResponse> => {
return customFetcher<verifyChannelsResponse>(getVerifyChannelsUrl(),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
channelVerifyRequest,)
}
);}
export const getVerifyChannelsMutationOptions = <TError = HTTPValidationError,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof verifyChannels>>, TError,{data: ChannelVerifyRequest}, TContext>, request?: SecondParameter<typeof customFetcher>}
): UseMutationOptions<Awaited<ReturnType<typeof verifyChannels>>, TError,{data: ChannelVerifyRequest}, TContext> => {
const mutationKey = ['verifyChannels'];
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 verifyChannels>>, {data: ChannelVerifyRequest}> = (props) => {
const {data} = props ?? {};
return verifyChannels(data,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type VerifyChannelsMutationResult = NonNullable<Awaited<ReturnType<typeof verifyChannels>>>
export type VerifyChannelsMutationBody = ChannelVerifyRequest
export type VerifyChannelsMutationError = HTTPValidationError
/**
* @summary Verify Channels
*/
export const useVerifyChannels = <TError = HTTPValidationError,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof verifyChannels>>, TError,{data: ChannelVerifyRequest}, TContext>, request?: SecondParameter<typeof customFetcher>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof verifyChannels>>,
TError,
{data: ChannelVerifyRequest},
TContext
> => {
const mutationOptions = getVerifyChannelsMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
+120
View File
@@ -27,6 +27,7 @@ import type {
ClinicCreate,
ClinicCreateResponse,
ClinicHistoryResponse,
ClinicResponse,
HTTPValidationError
} from '../../model';
@@ -128,6 +129,125 @@ export const useCreateClinic = <TError = HTTPValidationError,
return useMutation(mutationOptions, queryClient);
}
/**
* @summary Get Clinic
*/
export type getClinicResponse200 = {
data: ClinicResponse
status: 200
}
export type getClinicResponse422 = {
data: HTTPValidationError
status: 422
}
export type getClinicResponseSuccess = (getClinicResponse200) & {
headers: Headers;
};
export type getClinicResponseError = (getClinicResponse422) & {
headers: Headers;
};
export type getClinicResponse = (getClinicResponseSuccess | getClinicResponseError)
export const getGetClinicUrl = (hospitalId: string,) => {
return `/api/clinics/${hospitalId}`
}
export const getClinic = async (hospitalId: string, options?: RequestInit): Promise<getClinicResponse> => {
return customFetcher<getClinicResponse>(getGetClinicUrl(hospitalId),
{
...options,
method: 'GET'
}
);}
export const getGetClinicQueryKey = (hospitalId?: string,) => {
return [
`/api/clinics/${hospitalId}`
] as const;
}
export const getGetClinicQueryOptions = <TData = Awaited<ReturnType<typeof getClinic>>, TError = HTTPValidationError>(hospitalId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getClinic>>, TError, TData>>, request?: SecondParameter<typeof customFetcher>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetClinicQueryKey(hospitalId);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getClinic>>> = () => getClinic(hospitalId, requestOptions);
return { queryKey, queryFn, enabled: !!(hospitalId), staleTime: 60000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getClinic>>, TError, TData> & { queryKey: DataTag<QueryKey, TData> }
}
export type GetClinicQueryResult = NonNullable<Awaited<ReturnType<typeof getClinic>>>
export type GetClinicQueryError = HTTPValidationError
export function useGetClinic<TData = Awaited<ReturnType<typeof getClinic>>, TError = HTTPValidationError>(
hospitalId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getClinic>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getClinic>>,
TError,
Awaited<ReturnType<typeof getClinic>>
> , 'initialData'
>, request?: SecondParameter<typeof customFetcher>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> }
export function useGetClinic<TData = Awaited<ReturnType<typeof getClinic>>, TError = HTTPValidationError>(
hospitalId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getClinic>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getClinic>>,
TError,
Awaited<ReturnType<typeof getClinic>>
> , 'initialData'
>, request?: SecondParameter<typeof customFetcher>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> }
export function useGetClinic<TData = Awaited<ReturnType<typeof getClinic>>, TError = HTTPValidationError>(
hospitalId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getClinic>>, TError, TData>>, request?: SecondParameter<typeof customFetcher>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> }
/**
* @summary Get Clinic
*/
export function useGetClinic<TData = Awaited<ReturnType<typeof getClinic>>, TError = HTTPValidationError>(
hospitalId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getClinic>>, TError, TData>>, request?: SecondParameter<typeof customFetcher>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
const queryOptions = getGetClinicQueryOptions(hospitalId,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
query.queryKey = queryOptions.queryKey ;
return query;
}
/**
* @summary Get Clinic History
*/
export type getClinicHistoryResponse200 = {
+3 -3
View File
@@ -20,8 +20,8 @@ import type {
} from '@tanstack/react-query';
import type {
HTTPValidationError,
ReportResponse
GetReport200,
HTTPValidationError
} from '../../model';
import { customFetcher } from '../../api';
@@ -35,7 +35,7 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* @summary Get Report
*/
export type getReportResponse200 = {
data: ReportResponse
data: GetReport200
status: 200
}
+1 -4
View File
@@ -4,14 +4,11 @@
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { AnalysisCreateClinicId } from './analysisCreateClinicId';
import type { AnalysisCreateUrl } from './analysisCreateUrl';
import type { Channels } from './channels';
import type { AnalysisOptions } from './analysisOptions';
export interface AnalysisCreate {
clinic_id?: AnalysisCreateClinicId;
url?: AnalysisCreateUrl;
clinic_id: string;
channels: Channels;
options?: AnalysisOptions;
}
+13
View File
@@ -0,0 +1,13 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export interface ChannelScore {
score: number;
summary: string;
strengths: string[];
weaknesses: string[];
}
@@ -1,13 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelVerifyRequestYoutube } from './channelVerifyRequestYoutube';
import type { ChannelVerifyRequestInstagram } from './channelVerifyRequestInstagram';
export interface ChannelVerifyRequest {
youtube?: ChannelVerifyRequestYoutube;
instagram?: ChannelVerifyRequestInstagram;
}
@@ -1,13 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelVerifyResponseYoutube } from './channelVerifyResponseYoutube';
import type { ChannelVerifyResponseInstagram } from './channelVerifyResponseInstagram';
export interface ChannelVerifyResponse {
youtube?: ChannelVerifyResponseYoutube;
instagram?: ChannelVerifyResponseInstagram;
}
@@ -1,9 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelVerifyResponseInstagramAnyOfItem } from './channelVerifyResponseInstagramAnyOfItem';
export type ChannelVerifyResponseInstagram = ChannelVerifyResponseInstagramAnyOfItem[] | null;
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ChannelVerifyResponseInstagramAnyOfItem = { [key: string]: unknown };
@@ -1,9 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelVerifyResponseYoutubeAnyOf } from './channelVerifyResponseYoutubeAnyOf';
export type ChannelVerifyResponseYoutube = ChannelVerifyResponseYoutubeAnyOf | null;
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ChannelVerifyResponseYoutubeAnyOf = { [key: string]: unknown };
-5
View File
@@ -4,12 +4,7 @@
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ClinicCreateNameEn } from './clinicCreateNameEn';
import type { ClinicCreateAddress } from './clinicCreateAddress';
export interface ClinicCreate {
url: string;
name: string;
name_en?: ClinicCreateNameEn;
address?: ClinicCreateAddress;
}
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ClinicCreateNameEn = string | null;
+22
View File
@@ -0,0 +1,22 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ClinicResponseHospitalNameEn } from './clinicResponseHospitalNameEn';
import type { ClinicResponseRoadAddress } from './clinicResponseRoadAddress';
import type { ClinicResponseUrl } from './clinicResponseUrl';
import type { ClinicResponseRawData } from './clinicResponseRawData';
export interface ClinicResponse {
hospital_id: string;
hospital_name: string;
hospital_name_en: ClinicResponseHospitalNameEn;
road_address: ClinicResponseRoadAddress;
url: ClinicResponseUrl;
status: string;
raw_data: ClinicResponseRawData;
created_at: string;
updated_at: string;
}
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
export type AnalysisCreateClinicId = string | null;
export type ClinicResponseHospitalNameEn = string | null;
@@ -0,0 +1,9 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ClinicResponseRawDataAnyOf } from './clinicResponseRawDataAnyOf';
export type ClinicResponseRawData = ClinicResponseRawDataAnyOf | null;
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
export type ChannelVerifyRequestInstagram = string[] | null;
export type ClinicResponseRawDataAnyOf = { [key: string]: unknown };
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
export type ClinicCreateAddress = string | null;
export type ClinicResponseRoadAddress = string | null;
@@ -5,4 +5,4 @@
* OpenAPI spec version: 0.1.0
*/
export type AnalysisCreateUrl = string | null;
export type ClinicResponseUrl = string | null;
@@ -5,7 +5,7 @@
* OpenAPI spec version: 0.1.0
*/
export interface ClinicInfo {
name: string;
url: string;
export interface ConversionStrategy {
summary: string;
actions: string[];
}
@@ -4,5 +4,6 @@
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ReportOutput } from './reportOutput';
export type ChannelVerifyRequestYoutube = string | null;
export type GetReport200 = ReportOutput | null;
+15 -21
View File
@@ -6,22 +6,13 @@
*/
export * from './analysisCreate';
export * from './analysisCreateClinicId';
export * from './analysisCreateUrl';
export * from './analysisOptions';
export * from './analysisStartResponse';
export * from './analysisStatus';
export * from './analysisStatusResponse';
export * from './analysisStatusResponseChannelErrors';
export * from './analysisStatusResponseCompletedAt';
export * from './channelVerifyRequest';
export * from './channelVerifyRequestInstagram';
export * from './channelVerifyRequestYoutube';
export * from './channelVerifyResponse';
export * from './channelVerifyResponseInstagram';
export * from './channelVerifyResponseInstagramAnyOfItem';
export * from './channelVerifyResponseYoutube';
export * from './channelVerifyResponseYoutubeAnyOf';
export * from './channelScore';
export * from './channels';
export * from './channelsFacebook';
export * from './channelsGangnamUnni';
@@ -29,25 +20,28 @@ export * from './channelsInstagram';
export * from './channelsNaverBlog';
export * from './channelsYoutube';
export * from './clinicCreate';
export * from './clinicCreateAddress';
export * from './clinicCreateNameEn';
export * from './clinicCreateResponse';
export * from './clinicHistoryResponse';
export * from './clinicHistoryResponseMetricsTimeseries';
export * from './clinicInfo';
export * from './clinicResponse';
export * from './clinicResponseHospitalNameEn';
export * from './clinicResponseRawData';
export * from './clinicResponseRawDataAnyOf';
export * from './clinicResponseRoadAddress';
export * from './clinicResponseUrl';
export * from './conversionStrategy';
export * from './getReport200';
export * from './hTTPValidationError';
export * from './planCreate';
export * from './planResponse';
export * from './planResponseBrandGuide';
export * from './planResponseContentStrategy';
export * from './reportResponse';
export * from './reportResponseConversionStrategy';
export * from './reportResponseFacebook';
export * from './reportResponseGangnamUnni';
export * from './reportResponseInstagram';
export * from './reportResponseNaverBlog';
export * from './reportResponseNaverPlace';
export * from './reportResponseYoutube';
export * from './reportOutput';
export * from './reportOutputFacebook';
export * from './reportOutputGangnamUnni';
export * from './reportOutputInstagram';
export * from './reportOutputNaverBlog';
export * from './reportOutputYoutube';
export * from './runSummary';
export * from './runSummaryCompletedAt';
export * from './runSummaryOverallScore';
+24
View File
@@ -0,0 +1,24 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ReportOutputInstagram } from './reportOutputInstagram';
import type { ReportOutputFacebook } from './reportOutputFacebook';
import type { ReportOutputNaverBlog } from './reportOutputNaverBlog';
import type { ReportOutputYoutube } from './reportOutputYoutube';
import type { ReportOutputGangnamUnni } from './reportOutputGangnamUnni';
import type { ConversionStrategy } from './conversionStrategy';
export interface ReportOutput {
overall_score: number;
instagram?: ReportOutputInstagram;
facebook?: ReportOutputFacebook;
naver_blog?: ReportOutputNaverBlog;
youtube?: ReportOutputYoutube;
gangnam_unni?: ReportOutputGangnamUnni;
conversion_strategy: ConversionStrategy;
roadmap: string[];
kpis: string[];
}
@@ -0,0 +1,9 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelScore } from './channelScore';
export type ReportOutputFacebook = ChannelScore | null;
@@ -0,0 +1,9 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelScore } from './channelScore';
export type ReportOutputGangnamUnni = ChannelScore | null;
@@ -0,0 +1,9 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelScore } from './channelScore';
export type ReportOutputInstagram = ChannelScore | null;
@@ -0,0 +1,9 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelScore } from './channelScore';
export type ReportOutputNaverBlog = ChannelScore | null;
@@ -0,0 +1,9 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ChannelScore } from './channelScore';
export type ReportOutputYoutube = ChannelScore | null;
-30
View File
@@ -1,30 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
import type { ClinicInfo } from './clinicInfo';
import type { ReportResponseYoutube } from './reportResponseYoutube';
import type { ReportResponseInstagram } from './reportResponseInstagram';
import type { ReportResponseFacebook } from './reportResponseFacebook';
import type { ReportResponseNaverPlace } from './reportResponseNaverPlace';
import type { ReportResponseNaverBlog } from './reportResponseNaverBlog';
import type { ReportResponseGangnamUnni } from './reportResponseGangnamUnni';
import type { ReportResponseConversionStrategy } from './reportResponseConversionStrategy';
export interface ReportResponse {
id: string;
clinic: ClinicInfo;
overall_score: number;
youtube: ReportResponseYoutube;
instagram: ReportResponseInstagram;
facebook: ReportResponseFacebook;
naver_place: ReportResponseNaverPlace;
naver_blog: ReportResponseNaverBlog;
gangnam_unni: ReportResponseGangnamUnni;
conversion_strategy: ReportResponseConversionStrategy;
roadmap: unknown[];
kpis: unknown[];
generated_at: string;
}
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ReportResponseConversionStrategy = { [key: string]: unknown };
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ReportResponseFacebook = { [key: string]: unknown };
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ReportResponseGangnamUnni = { [key: string]: unknown };
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ReportResponseInstagram = { [key: string]: unknown };
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ReportResponseNaverBlog = { [key: string]: unknown };
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ReportResponseNaverPlace = { [key: string]: unknown };
@@ -1,8 +0,0 @@
/**
* Generated by orval v7.21.0 🍺
* Do not edit manually.
* FastAPI
* OpenAPI spec version: 0.1.0
*/
export type ReportResponseYoutube = { [key: string]: unknown };