Skip to content

Commit

Permalink
Merge pull request #33 from TEAM-ITERVIEW/#32
Browse files Browse the repository at this point in the history
[feat] 최초 면접 결과 조회 API
  • Loading branch information
cha2y0ung authored Mar 29, 2024
2 parents ebdc3e8 + ae2cfc3 commit 6323c28
Show file tree
Hide file tree
Showing 7 changed files with 366 additions and 131 deletions.
40 changes: 17 additions & 23 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ datasource db {
}

model Answer {
id Int @id @default(autoincrement())
interviewQuestionId Int @unique
questionId Int @unique
interviewId Int @unique
id Int @id @default(autoincrement())
interviewQuestionId Int @unique
questionId Int @unique
interviewId Int @unique
text String?
mumble Int?
silent Int?
talk Int?
time DateTime? @db.Time(6)
mumble Int
silent Int
talk Int
time Int
}

model Feedback {
Expand All @@ -29,11 +29,11 @@ model Feedback {
}

model Interview {
id Int @id @default(autoincrement())
userId Int @unique
subjectId Int @unique
startDateTime DateTime? @db.Timestamp(6)
endDateTime DateTime? @db.Timestamp(6)
id Int @id @default(autoincrement())
userId Int @unique
subjectId Int @unique
startDateTime String
endDateTime String
questionNum Int?
score Int?
otherFeedback String?
Expand All @@ -42,15 +42,9 @@ model Interview {
}

model Picture {
id Int @id @default(autoincrement())
interviewQuestionId Int @unique
angry Int?
disgust Int?
fear Int?
happy Int?
sad Int?
surprise Int?
neutral Int?
id Int @id @default(autoincrement())
interviewQuestionId Int @unique
emotion String
}

model Question {
Expand All @@ -70,7 +64,7 @@ model User {
id Int @id @default(autoincrement())
userName String
pictureURL String?
themeColor String? @db.Char(1)
themeColor String?
refreshToken String?
}

Expand Down
15 changes: 15 additions & 0 deletions src/controller/interviewController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,24 @@ const endInterview = async (req: Request, res: Response, next: NextFunction) =>
}
}

const firstResultInterview = async (req: Request, res: Response, next: NextFunction) => {
const {interviewId} = req.params

try {
const data = await interviewService.firstResultInterview(+interviewId);

return res
.status(statusCode.CREATED)
.send(success(statusCode.CREATED, message.FIRST_RESULT_INTERVIEW_SUCCESS, data));
} catch (error) {
next(error);
}
}

export default {
startInterview,
makeFeedback,
saveEmotion,
endInterview,
firstResultInterview,
};
8 changes: 1 addition & 7 deletions src/interface/DTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,5 @@ export interface startInterviewDTO {
}

export interface saveEmotionDTO{
angry: number;
disgust: number;
fear: number;
happy: number;
sad: number;
surprise: number;
neutral: number;
emotion: string;
}
1 change: 1 addition & 0 deletions src/module/constant/responseMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export default {
ACCESS_USERINFO_SUCCESS: "프로필 조회 성공",
UPDATE_USERINFO_SUCCESS: "프로필 수정 성공",
END_INTERVIEW_SUCCESS: "인터뷰 종료 성공",
FIRST_RESULT_INTERVIEW_SUCCESS: "첫번째 인터뷰 결과 조회 성공",
};
9 changes: 9 additions & 0 deletions src/router/interviewRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,14 @@ router.patch(
interviewController.endInterview,
);

router.get(
'/result/:interviewId',
[
param('interviewId').notEmpty(),
],
errorValidator,
interviewController.firstResultInterview,
);


export default router;
Loading

0 comments on commit 6323c28

Please sign in to comment.