-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: /presentations DTO 구현 및 API 연동 (#111) #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
ab29621
refactor: 타입 맞추기 (#111)
AndyH0ng e0566ff
fix: API 경로 수정 (#111)
AndyH0ng e7fd61a
fix: Presentation API 연결 (#111)
AndyH0ng b5ec59b
fix: /presentations API 연결 (#111)
AndyH0ng 4a8a219
Merge branch 'develop' into refactor/setting-type-111
AndyH0ng ff9abe7
feat: /comments API 연결 (#111)
AndyH0ng d8bbbe1
Merge branch 'refactor/setting-type-111' of https://github.com/TTORAN…
AndyH0ng 295b1ae
feat: 구글 로그인 연동 (#111)
AndyH0ng 6523ec7
feat: 네이버 카카오 로그인 연동 (#111)
AndyH0ng a026d8f
feat: 로그인 콜백 및 라우팅 (#111)
AndyH0ng 778b328
design: 제목 수정 팝오버 사용성 개선 (#111)
AndyH0ng 59b5a03
fix: 빌드 오류 해결 (#111)
AndyH0ng 06f29fb
refactor: api 연동 구조 변경 (#111)
kimyw1018 44f486e
refactor: 빌드에러 수정(#111)
kimyw1018 5e75db5
fix: 무한루프 해결(#111)
kimyw1018 eed8303
fix: SocialLoginSuccessResponseDto로 업데이트 (#111)
AndyH0ng 05bda5c
refactor: Script 타입을 DTO로 통합 (#111)
AndyH0ng 3ecaf2e
refactor: Slide 타입을 DTO로 통합 (#111)
AndyH0ng 0d632a5
refactor: Comment 타입을 DTO로 통합 (#111)
AndyH0ng 435a0d5
fix: DTO export 누락 및 import 오류 수정 (#111)
AndyH0ng 7e65f9c
Merge branch 'refactor/setting-type-111' of https://github.com/TTORAN…
kimyw1018 e27ed4a
refactor: Video DTO 구조 통일 (#111)
AndyH0ng d1a545b
Merge branch 'refactor/setting-type-111' of https://github.com/TTORAN…
AndyH0ng e633cfb
Merge branch 'develop' into refactor/setting-type-111
AndyH0ng 73dd156
fix: 빌드 오류 2/3 해결 (#111)
AndyH0ng 411b6ee
fix: Recording props 수정(#111)
kimyw1018 02119e3
fix: 클로드 리뷰 반영 (#111)
kimyw1018 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /** | ||
| * @file index.ts | ||
| * @description DTO 배럴 export | ||
| */ | ||
|
|
||
| export type { CreateProjectDto, UpdateProjectDto } from './projects.dto'; | ||
| export type { CreateSlideDto, UpdateSlideDto } from './slides.dto'; | ||
| export type { UpdateScriptDto, RestoreScriptDto } from './scripts.dto'; | ||
| export type { CreateOpinionDto } from './opinions.dto'; | ||
| export type { ToggleSlideReactionDto } from './reactions.dto'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /** | ||
| * 의견(댓글) 생성 요청 DTO | ||
| */ | ||
| export interface CreateOpinionDto { | ||
| content: string; | ||
| /** 답글인 경우 부모 의견 ID */ | ||
| parentId?: string; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /** | ||
| * 프로젝트 수정 요청 DTO | ||
| */ | ||
| export interface UpdateProjectDto { | ||
| title: string; | ||
| } | ||
|
|
||
| /** | ||
| * 프로젝트 생성 요청 DTO | ||
| */ | ||
| export interface CreateProjectDto { | ||
| title: string; | ||
| uploadFileId: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import type { ReactionType } from '@/types/script'; | ||
|
|
||
| /** | ||
| * 슬라이드 리액션 토글 요청 DTO | ||
| */ | ||
| export interface ToggleSlideReactionDto { | ||
| type: ReactionType; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /** | ||
| * 대본 저장 요청 DTO | ||
kimyw1018 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| */ | ||
| export interface UpdateScriptDto { | ||
| script: string; | ||
| } | ||
|
|
||
| /** | ||
| * 대본 복원 요청 DTO | ||
| */ | ||
| export interface RestoreScriptDto { | ||
| version: number; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| /** | ||
| * 슬라이드 제목 수정 요청 DTO | ||
| */ | ||
| export interface UpdateSlideDto { | ||
| title?: string; | ||
| } | ||
|
|
||
| /** | ||
| * 슬라이드 생성 요청 DTO | ||
| */ | ||
| export interface CreateSlideDto { | ||
| title: string; | ||
| script?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,76 +1,118 @@ | ||
| /** | ||
| * @file projects.ts | ||
| * @file presentations.ts | ||
| * @description 프로젝트 관련 API 엔드포인트 | ||
| * | ||
| * 서버와 통신하는 함수들을 정의합니다. | ||
| * 이 함수들은 직접 호출하지 않고, hooks/queries에서 사용합니다. | ||
| * | ||
| * 위에 interface로 받는 타입 정의 해주고 | ||
| * 아래에서 endpoint 맞춰주고 | ||
| */ | ||
| import type { Presentation } from '@/types/presentation'; | ||
|
|
||
| import { apiClient } from '../client'; | ||
| import { apiClient } from '@/api'; | ||
| import type { UpdateProjectDto } from '@/api/dto'; | ||
| import type { ApiResponse, ConversionStatusResponse } from '@/types/api'; | ||
| import type { | ||
| CreatePresentationRequest, | ||
| CreatePresentationSuccess, | ||
| Presentation, | ||
| PresentationListResponse, | ||
| ProjectUpdateResponse, | ||
| } from '@/types/presentation'; | ||
|
|
||
| /** | ||
| * 프로젝트 목록 조회 | ||
| * 프로젝트 목록 조회 (GET) | ||
| * | ||
| * 각 프로젝트는 id를 포함하며, 수정/삭제 시 이 id를 사용함. | ||
| * @returns 프로젝트 배열 | ||
| * @returns Presentation[] | ||
| */ | ||
| export async function getPresentations(): Promise<Presentation[]> { | ||
| const response = await apiClient.get<Presentation[]>(`/presentations`); | ||
| return response.data; | ||
| const response = await apiClient.get<ApiResponse<PresentationListResponse>>(`/presentations`); | ||
|
|
||
| if (response.data.resultType === 'SUCCESS') { | ||
| return response.data.success.presentations; | ||
| } | ||
| throw new Error(response.data.error.reason); | ||
kimyw1018 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /** | ||
| * 프로젝트 상세 조회 | ||
| * | ||
| * @param projectId - 프로젝트 ID | ||
| * @param projectId | ||
| * @returns Presentation | ||
| */ | ||
| export async function getPresentation(): Promise<Presentation> { | ||
| const response = await apiClient.get<Presentation>(`/presentations`); | ||
| return response.data; | ||
| } | ||
| export async function getPresentation(projectId: string): Promise<Presentation> { | ||
| const response = await apiClient.get<ApiResponse<Presentation>>(`/presentations/${projectId}`); | ||
|
|
||
| /** | ||
| * 프로젝트 수정 요청 타입 | ||
| */ | ||
| export interface UpdatePresentationRequest { | ||
| title?: string; | ||
| if (response.data.resultType === 'SUCCESS') { | ||
| return response.data.success; | ||
| } | ||
| throw new Error(response.data.error.reason); | ||
| } | ||
|
|
||
| /** | ||
| * 프로젝트 수정 | ||
| * 프로젝트 제목 수정 (PATCH) | ||
| * | ||
| * @param projectId - 수정할 프로젝트 ID | ||
| * @param data - 수정할 데이터 | ||
| * @returns 수정된 프로젝트 | ||
| * @param projectId | ||
| * @param data - 수정할 프로젝트 데이터 | ||
| * @returns ProjectUpdateResponse - 수정된 프로젝트 정보 | ||
| */ | ||
| export async function updatePresentation( | ||
| projectId: string, | ||
| data: UpdatePresentationRequest, | ||
| ): Promise<Presentation> { | ||
| const response = await apiClient.patch<Presentation>(`/presentations/${projectId}`, data); | ||
| return response.data; | ||
| data: UpdateProjectDto, | ||
| ): Promise<ProjectUpdateResponse> { | ||
| const response = await apiClient.patch<ApiResponse<ProjectUpdateResponse>>( | ||
| `/presentations/${projectId}`, | ||
| data, | ||
| ); | ||
|
|
||
| if (response.data.resultType === 'SUCCESS') { | ||
| return response.data.success; | ||
| } | ||
| throw new Error(response.data.error.reason); | ||
| } | ||
|
|
||
| /** | ||
| * 프로젝트 생성 | ||
| * 프로젝트 생성 (POST) | ||
| * | ||
| * @param data - 생성할 프로젝트 데이터 | ||
| * @returns 생성된 프로젝트 | ||
| * @returns CreatePresentationSuccess - 생성된 프로젝트 정보 | ||
| */ | ||
| export async function createPresentation(data: { title: string }): Promise<Presentation> { | ||
| const response = await apiClient.post<Presentation>(`/presentations`, data); | ||
| return response.data; | ||
| export async function createPresentation( | ||
| data: CreatePresentationRequest, | ||
| ): Promise<CreatePresentationSuccess> { | ||
| const response = await apiClient.post<ApiResponse<CreatePresentationSuccess>>( | ||
| `/presentations`, | ||
| data, | ||
| ); | ||
|
|
||
| if (response.data.resultType === 'SUCCESS') { | ||
| return response.data.success; | ||
| } | ||
| throw new Error(response.data.error.reason); | ||
| } | ||
|
|
||
| /** | ||
| * 프로젝트 삭제 | ||
| * 프로젝트 삭제 (DELETE) | ||
| * | ||
| * @param projectId - 삭제할 프로젝트 ID | ||
| * @param projectId | ||
| */ | ||
| export async function deletePresentation(projectId: string): Promise<void> { | ||
| await apiClient.delete(`/presentations/${projectId}`); | ||
| const response = await apiClient.delete<ApiResponse<null>>(`/presentations/${projectId}`); | ||
|
|
||
| if (response.data.resultType === 'FAILURE') { | ||
| throw new Error(response.data.error.reason); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * 프로젝트 파일 변환 상태 조회 (GET) | ||
| * | ||
| * @param projectId - 프로젝트 ID | ||
| * @returns ConversionStatusResponse - 변환 상태 정보 | ||
| */ | ||
| export async function getConversionStatus(projectId: string): Promise<ConversionStatusResponse> { | ||
| const response = await apiClient.get<ApiResponse<ConversionStatusResponse>>( | ||
| `/presentations/${projectId}/conversion-status`, | ||
| ); | ||
|
|
||
| if (response.data.resultType === 'SUCCESS') { | ||
| return response.data.success; | ||
| } | ||
| throw new Error(response.data.error.reason); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,36 @@ | ||
| /** | ||
| * @file reactions.ts | ||
| * @description 슬라이드 리액션 관련 API 엔드포인트 | ||
| */ | ||
| import { apiClient } from '@/api'; | ||
| import type { Reaction, ReactionType } from '@/types/script'; | ||
| import type { ToggleSlideReactionDto } from '@/api/dto'; | ||
| import type { ApiResponse } from '@/types/api'; | ||
| import type { Reaction } from '@/types/script'; | ||
|
|
||
| export interface ToggleReactionRequest { | ||
| type: ReactionType; | ||
| } | ||
| /** | ||
| * 리액션 토글 요청 타입 (하위 호환성) | ||
| * @deprecated ToggleSlideReactionDto 사용 권장 | ||
| */ | ||
| export type ToggleReactionRequest = ToggleSlideReactionDto; | ||
|
|
||
| /** | ||
| * 슬라이드 리액션 토글 | ||
| * | ||
| * @param slideId - 슬라이드 ID | ||
| * @param data - 리액션 데이터 | ||
| * @returns 업데이트된 리액션 배열 | ||
| */ | ||
| export async function toggleReaction( | ||
| slideId: string, | ||
| data: ToggleSlideReactionDto, | ||
| ): Promise<Reaction[]> { | ||
| const response = await apiClient.post<ApiResponse<Reaction[]>>( | ||
| `/slides/${slideId}/reactions`, | ||
| data, | ||
| ); | ||
|
|
||
| export const toggleReaction = async (slideId: string, data: ToggleReactionRequest) => { | ||
| const { data: response } = await apiClient.post<Reaction[]>(`/slides/${slideId}/reactions`, data); | ||
| return response; | ||
| }; | ||
| if (response.data.resultType === 'SUCCESS') { | ||
| return response.data.success; | ||
| } | ||
| throw new Error(response.data.error.reason); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.