コード例 #1
0
 @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);
 }
コード例 #2
0
 @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);
 }
コード例 #3
0
 @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);
 }