Skip to content

Commit

Permalink
Fix server style
Browse files Browse the repository at this point in the history
  • Loading branch information
eceeeren committed Dec 26, 2024
1 parent 5d2b6ab commit 9b2fdf8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public AttachmentUnit createAttachmentUnit(AttachmentUnit attachmentUnit, Attach
* @param updateUnit The new attachment unit data.
* @param updateAttachment The new attachment data.
* @param updateFile The optional file.
* @param studentVersionFile The student version of the original file.
* @param keepFilename Whether to keep the original filename or not.
* @param hiddenPages The hidden pages of attachment unit.
* @return The updated attachment unit.
Expand Down Expand Up @@ -219,6 +220,13 @@ public void prepareAttachmentUnitForClient(AttachmentUnit attachmentUnit) {
attachmentUnit.getLecture().setPosts(null);
}

/**
* Saves the student version of an attachment, updates its reference in the database,
* and deletes the old version if it exists.
*
* @param studentVersion the new student version file to be saved
* @param attachment the attachment to be updated
*/
public void saveStudentVersion(MultipartFile studentVersion, Attachment attachment) {
// Update student version of attachment
Path basePath = FilePathService.getAttachmentUnitFilePath().resolve(attachment.getAttachmentUnit().getId().toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,13 @@ private void checkFile(Path filePath) {
}
}

/**
* Retrieves the list of hidden slide numbers for a specific attachment unit within a lecture.
*
* @param attachmentUnitId the ID of the attachment unit
* @param lectureId the ID of the lecture
* @return the ResponseEntity with status 200 (OK) and with body the list of slides that are hidden
*/
@GetMapping("lectures/{lectureId}/attachment-units/{attachmentUnitId}/hidden-slides")
@EnforceAtLeastEditor
public ResponseEntity<List<Integer>> getAttachmentUnitHiddenSlides(@PathVariable Long attachmentUnitId, @PathVariable Long lectureId) {
Expand Down

0 comments on commit 9b2fdf8

Please sign in to comment.