@RequestMapping(value = "/avatar/{userId}", method = RequestMethod.GET) public void readAvatar(@PathVariable int userId, HttpServletResponse response) { User user = userDao.getById(userId); String avatarPath = user.getAvatar(); PathUtils.readPhoto(avatarPath, response); }
@RequestMapping(value = "/video/{lessonId}", method = RequestMethod.GET) public void readVideo(@PathVariable int lessonId, HttpServletResponse response) { String videoPath = lessonDao.getLesson(lessonId).getVideoUrl(); PathUtils.readPhoto(videoPath, response); }
@RequestMapping(value = "/photo/{courseId}", method = RequestMethod.GET) public void readPhotos(@PathVariable int courseId, HttpServletResponse response) { Course course = courseDao.getCourse(courseId); String imagePath = course.getImageUrl(); PathUtils.readPhoto(imagePath, response); }