Skip to content

Commit 840e66c

Browse files
authored
[CCI-4] 일대다 면접 리스트 조회, 상세 조회, 면접 신청 기능 추가 및 번호로 로그인하기 기능 추가 (#3)
* [CCI-4] feat : 일대다 면접 조회 API 및 면접 세부 조회 API, 면접 신청 API 연결 완료 * [CCI-4] feat : 로그인 기능 수정, 번호를 입력하면 로그인 가능 * [CCI-4] feat : 면접 신청 일부 버그 수정
1 parent c651825 commit 840e66c

File tree

7 files changed

+452
-237
lines changed

7 files changed

+452
-237
lines changed

api/interview.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import {
88
ApiResponseMemberInterviewStatusDTO,
99
endInterviewRequestDTO,
1010
ApiResponseInterviewEndResultDTO,
11+
InterviewOptionUpdateDTO,
12+
ApiResponseInterviewOptionUpdateResponseDTO,
13+
ApiResponseListInterviewGroupCardDTO,
14+
ApiResponseGroupInterviewDetailDTO,
15+
ApiResponseInterviewStartResponseDTO,
1116
} from "./types/interview-types";
1217

1318
// 면접 생성
@@ -29,6 +34,39 @@ export async function createMemberInterview(
2934
>(`/interviews/${interviewId}`, data);
3035
}
3136

37+
// 면접 옵션 수정
38+
export async function updateInterviewOption(
39+
interviewId: number,
40+
memberId: number,
41+
data: InterviewOptionUpdateDTO
42+
) {
43+
return serverFetch.patch<
44+
ApiResponseInterviewOptionUpdateResponseDTO,
45+
InterviewOptionUpdateDTO
46+
>(`/interviews/${interviewId}/option`, data, { memberId });
47+
}
48+
49+
// 1대다 면접 모집글 리스트 조회
50+
export async function getGroupInterviewCards() {
51+
return serverFetch.get<ApiResponseListInterviewGroupCardDTO>(
52+
"/interviews/group"
53+
);
54+
}
55+
56+
// 1대다 면접 모집글 상세 조회
57+
export async function getGroupInterviewDetail(interviewId: number) {
58+
return serverFetch.get<ApiResponseGroupInterviewDetailDTO>(
59+
`/interviews/group/${interviewId}`
60+
);
61+
}
62+
63+
// 면접 시작 API
64+
export async function startInterview(interviewId: number) {
65+
return serverFetch.get<ApiResponseInterviewStartResponseDTO>(
66+
`/interviews/${interviewId}/start`
67+
);
68+
}
69+
3270
// 대기실 내 사용자 상태 변경
3371
export async function changeParticipantsStatus(
3472
interviewId: number,

api/types/interview-types.ts

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,138 @@ export interface InterviewEndResultDTO {
105105
interviewId?: number;
106106
endedAt?: string;
107107
}
108+
109+
export interface InterviewOptionUpdateDTO {
110+
voiceType:
111+
| "MALE20"
112+
| "MALE30"
113+
| "MALE40"
114+
| "MALE50"
115+
| "FEMALE20"
116+
| "FEMALE30"
117+
| "FEMALE40"
118+
| "FEMALE50";
119+
questionNumber: number;
120+
answerTime: number;
121+
}
122+
123+
export interface ApiResponseInterviewOptionUpdateResponseDTO {
124+
isSuccess?: boolean;
125+
code?: string;
126+
message?: string;
127+
result?: InterviewOptionUpdateResponseDTO;
128+
}
129+
130+
export interface InterviewOptionUpdateResponseDTO {
131+
interviewId?: number;
132+
interviewOptionId?: number;
133+
voiceType?:
134+
| "MALE20"
135+
| "MALE30"
136+
| "MALE40"
137+
| "MALE50"
138+
| "FEMALE20"
139+
| "FEMALE30"
140+
| "FEMALE40"
141+
| "FEMALE50";
142+
questionNumber?: number;
143+
answerTime?: number;
144+
}
145+
146+
// 1대다(그룹) 면접 관련 타입
147+
export interface ApiResponseListInterviewGroupCardDTO {
148+
isSuccess?: boolean;
149+
code?: string;
150+
message?: string;
151+
result?: InterviewGroupCardDTO[];
152+
}
153+
154+
export interface InterviewGroupCardDTO {
155+
interviewId?: number;
156+
name?: string;
157+
description?: string;
158+
sessionName?: string;
159+
jobName?: string;
160+
interviewType?: "PERSONALITY" | "TECHNICAL";
161+
currentParticipants?: number;
162+
maxParticipants?: number;
163+
startedAt?: string;
164+
}
165+
166+
export interface ApiResponseGroupInterviewDetailDTO {
167+
isSuccess?: boolean;
168+
code?: string;
169+
message?: string;
170+
result?: GroupInterviewDetailDTO;
171+
}
172+
173+
export interface GroupInterviewDetailDTO {
174+
interviewId?: number;
175+
name?: string;
176+
description?: string;
177+
sessionName?: string;
178+
jobName?: string;
179+
interviewType?: "PERSONALITY" | "TECHNICAL";
180+
maxParticipants?: number;
181+
currentParticipants?: number;
182+
startedAt?: string;
183+
hostName?: string;
184+
groupInterviewParticipants?: GroupInterviewParticipantDTO[];
185+
}
186+
187+
export interface GroupInterviewParticipantDTO {
188+
memberId?: number;
189+
name?: string;
190+
submitted?: boolean;
191+
host?: boolean;
192+
}
193+
194+
// 면접 시작 관련 타입
195+
export interface ApiResponseInterviewStartResponseDTO {
196+
isSuccess?: boolean;
197+
code?: string;
198+
message?: string;
199+
result?: InterviewStartResponseDTO;
200+
}
201+
202+
export interface InterviewStartResponseDTO {
203+
interviewId?: number;
204+
interview?: InterviewDTO;
205+
options?: InterviewOptionDTO;
206+
participants?: ParticipantDTO[];
207+
}
208+
209+
export interface InterviewDTO {
210+
interviewId?: number;
211+
corporateName?: string;
212+
jobName?: string;
213+
startType?: "NOW" | "SCHEDULED";
214+
participantCount?: number;
215+
}
216+
217+
export interface InterviewOptionDTO {
218+
interviewFormat?: "INDIVIDUAL" | "GROUP";
219+
interviewType?: "PERSONALITY" | "TECHNICAL";
220+
voiceType?:
221+
| "MALE20"
222+
| "MALE30"
223+
| "MALE40"
224+
| "MALE50"
225+
| "FEMALE20"
226+
| "FEMALE30"
227+
| "FEMALE40"
228+
| "FEMALE50";
229+
questionNumber?: number;
230+
answerTime?: number;
231+
}
232+
233+
export interface ParticipantDTO {
234+
memberInterviewId?: number;
235+
resumeDTO?: ResumeSimpleDTO;
236+
coverLetterDTO?: any; // CoverletterDetailDTO 등 실제 타입에 맞게 수정 필요
237+
}
238+
239+
export interface ResumeSimpleDTO {
240+
resumeId?: number;
241+
fileUrl?: string;
242+
}

app/login/page.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,17 @@ export default function LoginPage() {
4141
</div>
4242
</div>
4343

44-
<Button variant="outline" className="w-full" onClick={() => { login(1); window.location.href = "/workspace" }}>
44+
<Button variant="outline" className="w-full" onClick={() => {
45+
const input = window.prompt('로그인할 멤버 ID를 입력하세요')
46+
if (!input) return
47+
const id = Number(input)
48+
if (isNaN(id) || id <= 0) {
49+
alert('올바른 숫자 ID를 입력하세요')
50+
return
51+
}
52+
login(id)
53+
window.location.href = "/workspace"
54+
}}>
4555
임시 로그인
4656
</Button>
4757
</div>

0 commit comments

Comments
 (0)