@@ -0,0 +1,1710 @@
+package com.huixinpn.dionysus.controller.course;%0A%0Aimport com.huixinpn.dionysus.domain.course.Course;%0Aimport com.huixinpn.dionysus.domain.user.User;%0Aimport com.huixinpn.dionysus.repository.CourseRepository;%0Aimport com.huixinpn.dionysus.repository.UserRepository;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.http.ResponseEntity;%0Aimport org.springframework.security.core.Authentication;%0Aimport org.springframework.security.core.context.SecurityContextHolder;%0Aimport org.springframework.web.bind.annotation.PathVariable;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.RestController;%0A%0A@RestController%0A@RequestMapping(%22/api/v1%22)%0Apublic class CourseController %7B%0A  @Autowired%0A  private CourseRepository courseRepository;%0A%0A  @Autowired%0A  private UserRepository userRepository;%0A%0A  @RequestMapping(value = %22/course/registration/%7Bid%7D%22, method = RequestMethod.GET)%0A  public ResponseEntity registerColurse(@PathVariable Long id) throws Exception %7B%0A    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();%0A    User login = (User) authentication.getPrincipal();%0A    User reloaded = userRepository.findOne(login.getId());%0A    Course course = courseRepository.findOne(id);%0A    if (course != null%0A        && (course.getCapacity() == null %7C%7C course.getUsers().size() %3C course.getCapacity())%0A        && !reloaded.getCourses().contains(course)) %7B%0A      reloaded.getCourses().add(course);%0A    %7D%0A    userRepository.save(reloaded);%0A    return new ResponseEntity(HttpStatus.OK);%0A  %7D%0A%7D%0A

add CourseController to process register course