forked from steime/plansch-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
55 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/ch/mab/plansch/demo/controller/ModulGroupController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,26 @@ | ||
package ch.mab.plansch.demo.controller; | ||
|
||
import ch.mab.plansch.demo.model.ModulGroup; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@RestController | ||
@RequestMapping("modulegroups") | ||
public class ModulGroupController { | ||
|
||
@GetMapping("{studentid}") | ||
public List<ModulGroup> retrieveAllModuleGroups(@PathVariable("studentid") UUID studentId) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@GetMapping("{studentid}/{id}") | ||
public List<ModulGroup> retrieveModuleGroupById(@PathVariable("studentid") UUID studentId) { | ||
return Collections.emptyList(); | ||
} | ||
} |
26 changes: 19 additions & 7 deletions
26
src/main/java/ch/mab/plansch/demo/controller/ModuleController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
package ch.mab.plansch.demo.controller; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import ch.mab.plansch.demo.model.ModuleVisit; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@RestController | ||
@RequestMapping("modules") | ||
public class ModuleController { | ||
|
||
@GetMapping | ||
public List<Module> retrieveAllModules() { | ||
@GetMapping("{studentid}") | ||
public List<Module> retrieveAllModules(@PathVariable("studentid") UUID studentId) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@GetMapping("/planned") | ||
public List<Module> retrievePlannedModules() { | ||
@GetMapping("visits/{studentid}") | ||
public List<ModuleVisit> retrieveVisitsModules(@PathVariable("studentid") UUID studentId) { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@PostMapping("visits/{studentid}") | ||
public void createModuleVisit(@PathVariable("studentid") UUID studentId, @RequestBody ModuleVisit moduleVisit) { | ||
} | ||
|
||
@PutMapping("visits/{studentid}/{id}") | ||
public void updateModuleVisit(@PathVariable("studentid") UUID studentId, @PathVariable("id") UUID moduleVisitId, @RequestBody ModuleVisit moduleVisit) { | ||
} | ||
|
||
@DeleteMapping("visits/{studentid}/{id}") | ||
public void deleteModulVisit(@PathVariable("studentid") UUID studentId, @PathVariable("id") UUID moduleVisitId) { | ||
} | ||
} |
13 changes: 10 additions & 3 deletions
13
src/main/java/ch/mab/plansch/demo/controller/StudentController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
package ch.mab.plansch.demo.controller; | ||
|
||
import ch.mab.plansch.demo.model.Student; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.UUID; | ||
|
||
@RestController | ||
@RequestMapping("students") | ||
@Api(value = "/", description = "Description of API") | ||
public class StudentController { | ||
|
||
@ApiOperation(value = "Retrieve student details") | ||
@GetMapping("{id}") | ||
public Student retrieveStudentDetails(@PathVariable("id") UUID id) { | ||
public Student retrieveStudent(@PathVariable("id") UUID id) { | ||
return new Student(); | ||
} | ||
|
||
|
||
|
||
@ApiOperation(value = "Create / register student") | ||
@PostMapping | ||
public Student createStudent(@RequestBody Student student) { | ||
return new Student(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
import java.util.UUID; | ||
|
||
public class ModulGroup { | ||
|
||
UUID id; | ||
String name; | ||
Set<Modul> modules; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters