Skip to content

Commit

Permalink
Merge branch 'dev' into feature-006
Browse files Browse the repository at this point in the history
  • Loading branch information
seungwoohan12 committed Feb 18, 2024
2 parents d30c303 + 794c09b commit c5a5521
Show file tree
Hide file tree
Showing 76 changed files with 2,108 additions and 929 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import SummaryPage from '@/pages/SummaryPage';
import Layout from '@/components/layout/Layout';

// Components
import { ToastList } from '@/components/common';
import { ModelController, ToastList } from '@/components/common';

// Hooks
import useUpdateCategories from '@/hooks/useUpdateCategories';
Expand All @@ -49,7 +49,6 @@ const App = () => {
useEffect(() => {
userToken && updateCategories();
}, [updateCategories, userToken]);

return (
<ThemeProvider theme={theme}>
<GlobalStyle />
Expand Down Expand Up @@ -102,6 +101,7 @@ const App = () => {
</BrowserRouter>

<ToastList />
<ModelController />
</ThemeProvider>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/apis/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const updateCategoryName = async (name: string, categoryId: number) => {

// 비디오의 카테고리 위치 수정 API
export const putVideoToOtherCategory = async (
video_id: number[],
video_id: number[] | undefined,
categoryId: number,
) => {
const response = await axiosInstance.patch(`/videos/${categoryId}/update`, {
Expand Down
2 changes: 1 addition & 1 deletion src/apis/config/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const baseURL =
? '/api'
: 'https://backend.vi-no.site';

const axiosInstance = axios.create({ baseURL });
const axiosInstance = axios.create({ baseURL, timeout: 1000 * 60 * 5 });

axiosInstance.interceptors.request.use((config) => {
config.withCredentials = true;
Expand Down
6 changes: 6 additions & 0 deletions src/apis/feedback.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import axiosInstance from './config/instance';

export const postFeedback = async (text: string) => {
const response = await axiosInstance.post('/feedback', { text });
return response;
};
6 changes: 5 additions & 1 deletion src/apis/search.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { APIResponse } from '@/models/config/axios';
import axios from './config/instance';
import { ResponseSearch } from '@/models/search';
import { ITag, ResponseSearch } from '@/models/search';

const PREFIX = '/search';

Expand All @@ -9,4 +9,8 @@ export const searchAPI = (type : string, keyword : string) => {
return axios.get<APIResponse<ResponseSearch>>(PREFIX + `/${type}/`, {
params : {[paramType] : keyword}
});
}

export const tagAPI = () => {
return axios.get<APIResponse<ITag[]>>('/videos/tag');
}
22 changes: 16 additions & 6 deletions src/apis/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ import {
FindEmailResponse,
FindEmailRequest,
FindPasswordResponse,
FindPasswordRequest
FindPasswordRequest,
CreateVideoAlarmRequest
} from '@/models/user';
import {
AlarmResponse,
ConfirmAlarmRequest,
DeleteAlarmRequest,
DeleteAlarmResponse,
} from '@/models/alarm';

import axios from './config/instance';

const PREFIX = '/user';
Expand Down Expand Up @@ -78,10 +80,18 @@ export const nickNameAPI = (data: NickNameRequest) => {
return axios.put<NickNameResponse>(PREFIX + '/nickname', data);
};

export const findEmailAPI = (data : FindEmailRequest) => {
return axios.post<FindEmailResponse>(
PREFIX + '/findEmail',
data
export const findEmailAPI = (data: FindEmailRequest) => {
return axios.post<FindEmailResponse>(PREFIX + '/findEmail', data);
};

export const createVideoAlarmAPI = (
videoId: number,
status: 'success' | 'fail',
data: CreateVideoAlarmRequest,
) => {
return axios.post<APIBaseResponse>(
PREFIX + `/videoAlarm/${videoId}/${status}`,
data,
);
}

Expand All @@ -90,4 +100,4 @@ export const findPasswordAPI = (data : FindPasswordRequest) => {
PREFIX + '/findPassword',
data
);
}
}
27 changes: 27 additions & 0 deletions src/apis/video.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import axios from './config/instance';

import { APIResponse } from '@/models/config/axios';
import {
ModelingProcessRequest,
ModelingProcessResponse,
ModelingResponse,
} from '@/models/modeling';

const PREFIX = '/video';

export const modelingProcess1 = (link: string) => {
return axios.post<APIResponse<ModelingProcessResponse>>(
PREFIX + `/?v=${encodeURIComponent(link)}`,
);
};

export const modelingProcess2 = (data: ModelingProcessRequest) => {
return axios.post<APIResponse<ModelingProcessResponse>>(
PREFIX + `/speech`,
data,
);
};

export const modelingProcess3 = (data: ModelingProcessRequest) => {
return axios.post<APIResponse<ModelingResponse>>(PREFIX + `/summary`, data);
};
17 changes: 16 additions & 1 deletion src/apis/videos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
IVideo,
UpdateVideoCategoryRequest,
UpdateVideoRequest,
VideoResponse,
VideoVersionType,
} from '@/models/video';

Expand All @@ -12,14 +13,18 @@ import { IVideoProps } from 'types/videos';

const PREFIX = '/videos';

export const createVideoAPI = (data: IVideo) => {
return axios.post<APIResponse<IVideo>>(PREFIX + `/new-video`, data);
};

export const getVideoAPI = (
videoId: string | number,
versionId: VideoVersionType = 'revision',
) => {
return axios.get<APIResponse<IVideo>>(PREFIX + `/${videoId}/${versionId}`);
};

export const deleteVideos = async (videos: number[]) => {
export const deleteVideos = async (videos: number[] | undefined) => {
const response = await axiosInstance.delete('/videos/selectDelete', {
data: { videos },
});
Expand Down Expand Up @@ -67,6 +72,10 @@ export const deleteVideoSummaryAPI = (summaryId: number) => {
return axios.delete<APIBaseResponse>(PREFIX + `/${summaryId}/deleteSummary`);
};

export const getUnReadDummyVideosAPI = () => {
return axios.get<APIResponse<VideoResponse>>('/videos/dummyVideos/unRead');
};

export const getUnReadDummyVideos = async (): Promise<
APIResponse<Record<'videos', IVideoProps[]>>
> => {
Expand All @@ -91,3 +100,9 @@ export const createDummyVideoToMine = async (

return response.data;
};

export const getVideoModeling = async (url: string) => {
const response = await axiosInstance.get(`/video/?v=${url}`);
console.log(response);
return response.data;
};
26 changes: 26 additions & 0 deletions src/assets/guideprogress1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions src/assets/guideprogress2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/guideprogress3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c5a5521

Please sign in to comment.