Added controllers description

This commit is contained in:
BuildTools
2020-11-04 16:40:02 +01:00
parent ba26d67cd4
commit b308373062
8 changed files with 35 additions and 6 deletions

View File

@ -19,17 +19,22 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
@RestController
@CrossOrigin
@RequestMapping("/api/" + App.API_VERSION + "/groups")
@Api(tags = {
"Group" }, value = "Group", description = "Enpoints to deal with gorups. Group is related directly to course and can be either class and lecture")
public class GroupController {
@Autowired
private GroupService groupService;
@GetMapping("/course/{id}")
public ResponseEntity<GetCourseGroupsResponse<? extends DefaultGroupResponse>> getCourses(@PathVariable(name = "id") Long id,
public ResponseEntity<GetCourseGroupsResponse<? extends DefaultGroupResponse>> getCourses(
@PathVariable(name = "id") Long id,
@RequestParam(name = "capacity", defaultValue = "true") Boolean capacity) {
List<Groups> groups = this.groupService.getGroupsByCourse(id);
if (capacity) {