Api params

This commit is contained in:
BuildTools
2020-11-04 17:23:29 +01:00
parent 4818905422
commit 6a7fc03e7c
6 changed files with 18 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.List;
@ -49,7 +50,9 @@ 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 {
public ResponseEntity<String> addCommision(
@RequestBody @ApiParam(value = "List of groups ids user want to assign to. If group doesnt exisit error will be thrown", example = "[12,7,3]") List<Long> groups)
throws UserNotFoundException {
User user = this.getCurrentUser().orElseThrow(() -> new NullPointerException());
Commision com = new Commision(user);