feat: quiz, lecture 이미지 등록시 파일 형식 확인
This commit is contained in:
parent
abcf4b7959
commit
a0b363d74f
@ -36,6 +36,10 @@ public class LectureController {
|
||||
return new ResponseEntity<>(HttpStatus.CONFLICT);
|
||||
}
|
||||
|
||||
if (!image.isEmpty() && !image.getContentType().startsWith("image")) {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
lectureService.createLecture(userId, lectureCreateRequest, image);
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
|
@ -38,6 +38,12 @@ public class QuizController {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
for (MultipartFile image : images) {
|
||||
if (!image.isEmpty() && !image.getContentType().startsWith("image")) {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
QuizSet quizSet = quizSetService.createQuizSet(userId, quizSetCreateRequest.getTitle());
|
||||
|
||||
int imageIdx = 0;
|
||||
@ -81,6 +87,12 @@ public class QuizController {
|
||||
return new ResponseEntity<>(HttpStatus.CONFLICT);
|
||||
}
|
||||
|
||||
for (MultipartFile image : images) {
|
||||
if (!image.isEmpty() && !image.getContentType().startsWith("image")) {
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
quizSetService.updateQuizSet(quizSetUpdateRequest.getId(), quizSetUpdateRequest.getTitle());
|
||||
|
||||
Map<Long, Boolean> quizUpdatedCheckMap = new HashMap<>();
|
||||
|
Loading…
Reference in New Issue
Block a user