Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Videos and Files Storage Component #35

Merged
merged 17 commits into from
Dec 18, 2024

Conversation

ahmedayman4a
Copy link
Collaborator

No description provided.

@ahmedayman4a ahmedayman4a self-assigned this Dec 18, 2024
Copy link

github-actions bot commented Dec 18, 2024

Code Coverage Summary

Overall Project 84.87% -0.73% 🍏
Files changed 97.31% 🍏

File Coverage
FileValidationException.java 100% 🍏
ResourceNotFoundException.java 100% 🍏
Video.java 100% 🍏
File.java 100% 🍏
CloudinaryConfig.java 100% 🍏
FileValidator.java 100% 🍏
CourseStorageController.java 100% 🍏
StorageService.java 100% 🍏
LocalStorageService.java 100% 🍏
CourseStorageService.java 96.21% -3.79% 🍏
CloudinaryService.java 91.46% -8.54% 🍏
GlobalExceptionHandler.java 33.33% 🍏

@ahmedyoussefg ahmedyoussefg self-assigned this Dec 18, 2024
@ahmedyoussefg ahmedyoussefg self-requested a review December 18, 2024 02:11
Copy link
Owner

@ahmedyoussefg ahmedyoussefg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, Great job! I approve the changes but once the coverage is increased.

private static final List<String> ALLOWED_FILE_TYPES = Arrays.asList("pdf", "doc", "docx", "ppt", "pptx", "png", "jpg", "jpeg", "txt");
private static final List<String> ALLOWED_VIDEO_TYPES = Arrays.asList("mp4", "avi", "mov");
private static final long MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB
private static final long MAX_VIDEO_SIZE = 100 * 1024 * 1024; // 100MB
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a concern in the future, but no problem for now

cloudinary.cloud-name=dfwyg3lbr
cloudinary.api-key=764171541677637
cloudinary.api-secret=nzfm9vGh-bBCfyKCSQkKwnZ26aE
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On release of milestone 2, we should add these to environment variables along with the OAuth2 secret keys

@Test
@WithMockUser(roles = "USER")
void uploadFile_Success() throws Exception {
when(storageService.storeFile(any(FileUploadDTO.class))).thenReturn(fileResponseDTO);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look on PR #20 when you are free

@ahmedyoussefg ahmedyoussefg merged commit c851213 into devel Dec 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants