Interface FileUploadService
- All Known Implementing Classes:
FileUploadServiceImpl
@Service
public interface FileUploadService
The
FileUploadService
interface is used to
store the images in the database.-
Method Summary
Modifier and TypeMethodDescriptionchangeImage
(Long studentId, StudentImageType imageType, org.springframework.web.multipart.MultipartFile file) A method which is used to change the images for the given type and student.deleteImage
(Long studentId) A method which is used to delete the images from the database.org.springframework.data.domain.Page<StudentImage>
getAllImages
(Integer page, Integer size) A method which is used to get all the student images from the database.byte[]
getImageForType
(Long studentId, StudentImageType type) A method which is used to get the images for the given type and student id.getStudentImageById
(Long studentId) A method which is used to get the images for the given student.uploadFile
(Long studentId, org.springframework.web.multipart.MultipartFile passportFile, org.springframework.web.multipart.MultipartFile selfieFile) A method used to store the images in the database.
-
Method Details
-
uploadFile
String uploadFile(Long studentId, org.springframework.web.multipart.MultipartFile passportFile, org.springframework.web.multipart.MultipartFile selfieFile) A method used to store the images in the database.- Parameters:
studentId
- The id of the student.passportFile
- The passport file.selfieFile
- The selfie file.- Returns:
- A feedback message.
-
getAllImages
A method which is used to get all the student images from the database.- Parameters:
page
- The page number.size
- The number of elements in a single page.- Returns:
- A page containing the student's images.
-
deleteImage
A method which is used to delete the images from the database.- Parameters:
studentId
- The id of the student.- Returns:
- An informational message.
-
getImageForType
A method which is used to get the images for the given type and student id.- Parameters:
studentId
- The id of the student.type
- The image type.- Returns:
- The image.
-
changeImage
StudentImage changeImage(Long studentId, StudentImageType imageType, org.springframework.web.multipart.MultipartFile file) A method which is used to change the images for the given type and student.- Parameters:
studentId
- The id of the student.imageType
- The image type.file
- The new image.- Returns:
- The message.
-
getStudentImageById
A method which is used to get the images for the given student.- Parameters:
studentId
- The id of the student.- Returns:
- The images of the student.
-