Api operations

This commit is contained in:
BuildTools
2020-11-04 16:58:26 +01:00
parent b308373062
commit 4818905422
7 changed files with 15 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
@ -47,6 +48,7 @@ public class CommisionController extends TokenBasedController {
}
@PostMapping("/user")
@ApiOperation("Create commision with assignents to given groups. If group doesn't exist error will be thrown")
public ResponseEntity<String> addCommision(@RequestBody List<Long> groups) throws UserNotFoundException {
User user = this.getCurrentUser().orElseThrow(() -> new NullPointerException());
@ -63,6 +65,7 @@ public class CommisionController extends TokenBasedController {
}
@GetMapping("/user")
@ApiOperation("Return list of user all commisions (history of schedules)")
public ResponseEntity<List<CommisionResponse>> getAlCommisions() throws UserNotFoundException {
User user = this.getCurrentUser().orElseThrow(() -> new NullPointerException());
List<CommisionResponse> result = CommisionResponseMappers