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 Type
    Method
    Description
    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.
    deleteImage(Long studentId)
    A method which is used to delete the images from the database.
    org.springframework.data.domain.Page<StudentImage>
    A method which is used to get all the student images from the database.
    byte[]
    A method which is used to get the images for the given type and student id.
    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

      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.
      Parameters:
      page - The page number.
      size - The number of elements in a single page.
      Returns:
      A page containing the student's images.
    • deleteImage

      String deleteImage(Long studentId)
      A method which is used to delete the images from the database.
      Parameters:
      studentId - The id of the student.
      Returns:
      An informational message.
    • getImageForType

      byte[] getImageForType(Long studentId, StudentImageType type)
      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

      StudentImage getStudentImageById(Long studentId)
      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.