-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [디디] 체스 스프링 실습 1단계 제출합니다. (#12) * initial commit * fix : build.gradle mysql 의존성 추가 * refactor : 왕이 죽었을 때 게임이 종료 안되는 버그 수정 * refactor : 버튼으로 방에 입장할 수 있도록 함 * refactor : 방을 삭제하고 나서 새로고침해야 적용되던 문제 수정 * feat : 방에 입장하자마자 게임을 바로 불러오도록 하고 못 불러왔을 시 게임을 초기화하는 기능 추가, refactor : 불러왔을 때 현재 Turn이 나오지 않는 문제 수정 * refactor, style : tab 공백을 space로 변경, 익명 객체 람다식으로 수정 * feat : Spring room Controller 구현 - 방 제목 empty 에 대한 validation 추가 - default 요청시 바로 방 목록을 불러오도록 수정 * feat, refactor : Dto 생성 방식 수정, 게임 컨트롤러 구현 - 게임 초기화 기능 구현 Co-authored-by: aegis <[email protected]> * [디디] 체스 - 스프링 실습 2단계 제출합니다. (#73) * refactor : 사용하지 않는 클래스 삭제 * refactor : 디폴트 생성자 접근제어자 수정 * refactor : 디폴트 생성자 접근제어자 수정 * refactor : 디폴트 생성자 접근제어자 수정 * refactor : Object 객체 타입 파라미터 반영하도록 수정 * refactor : 필드간 공백 추가 * refactor : 사용하지 않는 메서드 삭제 * refactor : 필드 접근제어자 추가 * style : 공백 추가 * feat : gameController init, movablePosition 구현 - todo : move시 에러 * feat : move 예외 처리 작업중 * refactor : spring MVC 구조에 맞게 refactor - GameController 예외 알맞게 처리 - DAO 클래스 Repository로 설정 - Service의 DAO를 bean으로 주입 * docs : README.md 추가 * test : domain test 메서드 추가 * refactor : 사용하지 않은 메서드 삭제 및 공백 수정 * refactor, fix : Spark Application과 Spring Application 이 모두 동작하도록 수정, 점수가 제대로 나오지 않는 버그 수정 * style : 공백 삭제 * refactor : move 메서드가 Post방식의 Json으로 요청을 받도록 수정 - front의 request uri 수정 - MoveManagerDTO 클래스로 request 매핑 * refactor : 불필요한 attribute 삭제 * refactor : move 메서드 리턴 타입 수정, 클래스명 수정 * refactor : 서비스 메서드 불필요한 동작 수정 Co-authored-by: aegis <[email protected]> Co-authored-by: DD <[email protected]>
- Loading branch information
Showing
43 changed files
with
1,681 additions
and
727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,35 @@ | ||
package wooteco.chess; | ||
|
||
import wooteco.chess.controller.SparkGameController; | ||
import wooteco.chess.controller.SparkRoomController; | ||
import com.google.gson.Gson; | ||
import com.google.gson.JsonObject; | ||
import wooteco.chess.sparkcontroller.SparkGameController; | ||
import wooteco.chess.sparkcontroller.SparkRoomController; | ||
|
||
import static spark.Spark.*; | ||
import static spark.Spark.exception; | ||
|
||
public class SparkChessApplication { | ||
public static void main(String[] args) { | ||
port(4567); | ||
staticFiles.location("/static"); | ||
externalStaticFileLocation("src/main/resources/templates"); | ||
|
||
// get(SparkRoomController.BASIC_URL, SparkRoomController.getAllRoom); | ||
// get(SparkRoomController.CREATE_ROOM_URL, SparkRoomController.createRoom); | ||
// get(SparkRoomController.REMOVE_ROOM_URL, SparkRoomController.removeRoom); | ||
// get(SparkRoomController.ENTER_ROOM_URL, SparkRoomController.enterRoom); | ||
// | ||
// get(SparkGameController.INIT_URL, SparkGameController::initGame); | ||
// post(SparkGameController.MOVE_URL, SparkGameController::movePiece); | ||
// get(SparkGameController.STATUS_URL, SparkGameController::showStatus); | ||
// get(SparkGameController.LOAD_URL, SparkGameController::loadGame); | ||
// get(SparkGameController.GET_URL, SparkGameController::getMovablePositions); | ||
// | ||
// exception(IllegalArgumentException.class, (e, req, res) -> { | ||
// Gson gson = new Gson(); | ||
// JsonObject object = new JsonObject(); | ||
// | ||
// object.addProperty("errorMessage", e.getMessage()); | ||
// res.body(gson.toJson(object)); | ||
// }); | ||
get(SparkRoomController.BASIC_URL, SparkRoomController.getAllRoom); | ||
get(SparkRoomController.CREATE_ROOM_URL, SparkRoomController.createRoom); | ||
get(SparkRoomController.REMOVE_ROOM_URL, SparkRoomController.removeRoom); | ||
get(SparkRoomController.ENTER_ROOM_URL, SparkRoomController.enterRoom); | ||
|
||
get(SparkGameController.INIT_URL, SparkGameController::initGame); | ||
post(SparkGameController.MOVE_URL, SparkGameController::movePiece); | ||
get(SparkGameController.STATUS_URL, SparkGameController::showStatus); | ||
get(SparkGameController.LOAD_URL, SparkGameController::loadGame); | ||
get(SparkGameController.GET_URL, SparkGameController::getMovablePositions); | ||
|
||
exception(IllegalArgumentException.class, (e, req, res) -> { | ||
Gson gson = new Gson(); | ||
JsonObject object = new JsonObject(); | ||
|
||
object.addProperty("errorMessage", e.getMessage()); | ||
res.body(gson.toJson(object)); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 0 additions & 97 deletions
97
src/main/java/wooteco/chess/controller/SparkGameController.java
This file was deleted.
Oops, something went wrong.
55 changes: 0 additions & 55 deletions
55
src/main/java/wooteco/chess/controller/SparkRoomController.java
This file was deleted.
Oops, something went wrong.
58 changes: 21 additions & 37 deletions
58
src/main/java/wooteco/chess/controller/SpringGameController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.