Fix move quoting

This commit is contained in:
2025-12-14 23:13:39 +01:00
parent 9ee3539eeb
commit 499639823e
9 changed files with 174 additions and 32 deletions

View File

@@ -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

View File

@@ -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;
}
}