Merge branch 'be/lecture' into 'backend'
feat: quiz, lecture 이미지 등록시 파일 형식 확인 See merge request s11-webmobile1-sub2/S11P12A701!173
This commit is contained in:
commit
3d1436ad47
@ -36,6 +36,10 @@ public class LectureController {
|
|||||||
return new ResponseEntity<>(HttpStatus.CONFLICT);
|
return new ResponseEntity<>(HttpStatus.CONFLICT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!image.isEmpty() && !image.getContentType().startsWith("image")) {
|
||||||
|
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||||
|
}
|
||||||
|
|
||||||
lectureService.createLecture(userId, lectureCreateRequest, image);
|
lectureService.createLecture(userId, lectureCreateRequest, image);
|
||||||
|
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
@ -38,6 +38,12 @@ public class QuizController {
|
|||||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
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());
|
QuizSet quizSet = quizSetService.createQuizSet(userId, quizSetCreateRequest.getTitle());
|
||||||
|
|
||||||
int imageIdx = 0;
|
int imageIdx = 0;
|
||||||
@ -81,6 +87,12 @@ public class QuizController {
|
|||||||
return new ResponseEntity<>(HttpStatus.CONFLICT);
|
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());
|
quizSetService.updateQuizSet(quizSetUpdateRequest.getId(), quizSetUpdateRequest.getTitle());
|
||||||
|
|
||||||
Map<Long, Boolean> quizUpdatedCheckMap = new HashMap<>();
|
Map<Long, Boolean> quizUpdatedCheckMap = new HashMap<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user