Unverified Commit 0d16074e authored by Ankit Verma's avatar Ankit Verma Committed by GitHub
Browse files

Merge pull request #171 from UPHRH-platform/bug_fix_question_paper_upload

fix for question paper upload
Showing with 5 additions and 5 deletions
+5 -5
...@@ -32,9 +32,9 @@ public class QuestionPaperController { ...@@ -32,9 +32,9 @@ public class QuestionPaperController {
} }
@PostMapping("/upload") @PostMapping("/upload")
public ResponseEntity<ResponseDto> upload(Long examCycleId, @RequestAttribute(Constants.Parameters.USER_ID) String createdBy, MultipartFile file) { public ResponseEntity<ResponseDto> upload(Long examCycleId, Long examId, @RequestAttribute(Constants.Parameters.USER_ID) String createdBy, MultipartFile file) {
try { try {
ResponseDto response = attachmentService.upload(examCycleId, createdBy, file); ResponseDto response = attachmentService.upload(examCycleId, examId, createdBy, file);
return new ResponseEntity<>(response, response.getResponseCode()); return new ResponseEntity<>(response, response.getResponseCode());
} catch (Exception e) { } catch (Exception e) {
return HandleResponse.handleErrorResponse(e); return HandleResponse.handleErrorResponse(e);
......
...@@ -13,5 +13,5 @@ public interface AttachmentService { ...@@ -13,5 +13,5 @@ public interface AttachmentService {
ResponseDto deleteQuestionPaper(Long id); ResponseDto deleteQuestionPaper(Long id);
ResponseDto upload(Long examCycleId, String createdBy, MultipartFile file); ResponseDto upload(Long examCycleId, Long examId, String createdBy, MultipartFile file);
} }
...@@ -179,7 +179,7 @@ public class AttachmentServiceImpl implements AttachmentService { ...@@ -179,7 +179,7 @@ public class AttachmentServiceImpl implements AttachmentService {
} }
@Override @Override
public ResponseDto upload(Long examCycleId, String createdBy, MultipartFile file) { public ResponseDto upload(Long examCycleId, Long examId, String createdBy, MultipartFile file) {
ResponseDto response = new ResponseDto(Constants.API_QUESTION_PAPER_UPLOAD); ResponseDto response = new ResponseDto(Constants.API_QUESTION_PAPER_UPLOAD);
Path filePath = null; Path filePath = null;
try { try {
...@@ -200,7 +200,7 @@ public class AttachmentServiceImpl implements AttachmentService { ...@@ -200,7 +200,7 @@ public class AttachmentServiceImpl implements AttachmentService {
storage.create(blobInfo, new FileInputStream(filePath.toFile())); storage.create(blobInfo, new FileInputStream(filePath.toFile()));
//Get Details from other table //Get Details from other table
Exam examDetails = examRepository.findByExamCycleIdAndObsolete(examCycleId, 0).orElse(null); Exam examDetails = examRepository.findByIdAndObsolete(examId, 0).orElse(null);
LocalDate examDate = null; LocalDate examDate = null;
String examName = null; String examName = null;
LocalTime examStartTime = null; LocalTime examStartTime = null;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment