File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/main/java/com/gabriel_torelo/game_list/controllers Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 44import org .springframework .beans .factory .annotation .Autowired ;
55import org .springframework .web .bind .annotation .GetMapping ;
66import org .springframework .web .bind .annotation .PathVariable ;
7+ import org .springframework .web .bind .annotation .PostMapping ;
8+ import org .springframework .web .bind .annotation .RequestBody ;
79import org .springframework .web .bind .annotation .RequestMapping ;
810import org .springframework .web .bind .annotation .RestController ;
11+ import com .gabriel_torelo .game_list .dto .ChangePositionDTO ;
912import com .gabriel_torelo .game_list .dto .GameListDTO ;
1013import com .gabriel_torelo .game_list .dto .GameMinDTO ;
1114import com .gabriel_torelo .game_list .services .GameListService ;
@@ -35,4 +38,9 @@ public GameListDTO readID(@PathVariable Long id) {
3538 public List <GameMinDTO > readListID (@ PathVariable Long id ) {
3639 return gameService .readListID (id );
3740 }
41+
42+ @ PostMapping (value = "/{id}/change" )
43+ public void moveGame (@ PathVariable Long id , @ RequestBody ChangePositionDTO reqBody ) {
44+ gameListService .moveGame (id , reqBody .getCurrentIndex (), reqBody .getNewIndex ());
45+ }
3846}
You can’t perform that action at this time.
0 commit comments