Fix move quoting
This commit is contained in:
@@ -2,6 +2,7 @@ package be.naaturel.boardmateapi.controllers;
|
||||
|
||||
import be.naaturel.boardmateapi.common.exceptions.ServiceException;
|
||||
import be.naaturel.boardmateapi.common.models.Game;
|
||||
import be.naaturel.boardmateapi.controllers.dtos.MoveDto;
|
||||
import be.naaturel.boardmateapi.controllers.dtos.ResponseBody;
|
||||
import be.naaturel.boardmateapi.controllers.dtos.GameDto;
|
||||
import be.naaturel.boardmateapi.controllers.mappings.GameMapper;
|
||||
@@ -60,10 +61,10 @@ public class GameController {
|
||||
}
|
||||
|
||||
@PostMapping("/moves/add/{gameId}")
|
||||
public ResponseEntity<ResponseBody<String>> AddMove(@PathVariable String gameId, @RequestBody String move){
|
||||
public ResponseEntity<ResponseBody<String>> AddMove(@PathVariable String gameId, @RequestBody MoveDto move){
|
||||
ResponseBody<String> result = ResponseBody.createEmpty();
|
||||
try{
|
||||
String gamedId = service.addMove(gameId, move);
|
||||
String gamedId = service.addMove(gameId, move.getNotation());
|
||||
result.setSuccess(true);
|
||||
result.setData(gamedId);
|
||||
return ResponseEntity
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package be.naaturel.boardmateapi.controllers.dtos;
|
||||
|
||||
public class MoveDto {
|
||||
private String notation;
|
||||
|
||||
public String getNotation() {
|
||||
return notation;
|
||||
}
|
||||
|
||||
public void setNotation(String notation){
|
||||
this.notation = notation;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user