-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from M2GIL/dev
v1
- Loading branch information
Showing
72 changed files
with
4,785 additions
and
244 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"THE BEER-WARE LICENSE" (Revision 42): | ||
[email protected] wrote this file. As long as you retain this notice you | ||
can do whatever you want with this stuff. If we meet some day, and you think | ||
this stuff is worth it, you can buy me a beer in return. | ||
|
||
M2GIL 2017 |
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,3 +1,16 @@ | ||
# iataaa-server | ||
# Iataaa Server | ||
Iataaa Server is web platform which manages draught game beetween web services. | ||
|
||
## Getting Started | ||
### Building the project | ||
Execute `mvn clean install` in the root directory to build maven project. | ||
|
||
### Deploy the project | ||
Execute `mvn spring-boot:run` in the root directory to deploy spring boot project. | ||
|
||
Navigate to http://localhost:8080. | ||
|
||
You can to change the default port in `/src/main/resources/application.properties` | ||
|
||
## Documentation | ||
* [See the docs](https://github.com/M2GIL/IAtaaa-server/wiki/Communication) |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
mvn spring-boot:run |
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 |
---|---|---|
@@ -0,0 +1,124 @@ | ||
get : | ||
description : Get game names. | ||
responses : | ||
200 : | ||
body : | ||
application/json : | ||
type : GameLibrary.GamesNamesResponse | ||
example : | ||
content : | ||
- game1 | ||
- game2 | ||
status : OK | ||
post : | ||
description : Create game. | ||
body: | ||
application/json: | ||
type: GameLibrary.GamePlayers | ||
responses : | ||
204 : | ||
description : Game created. | ||
409 : | ||
description : Error in creation game. | ||
body : | ||
application/json : | ||
type : GameLibrary.GamesPlayersResponse | ||
example : | ||
content : | ||
- #1 | ||
gameID: aiGame1 | ||
players : | ||
- p1 | ||
- p2 | ||
- #2 | ||
gameID: aiGame2 | ||
players : | ||
- p3 | ||
- p4 | ||
status : PLAYERS_NO_FOUND | ||
|
||
|
||
/{gameId} : | ||
get : | ||
description : Get game with game id. | ||
responses : | ||
200 : | ||
body : | ||
application/json : | ||
type : GameLibrary.GamesStatusResponse | ||
example: | ||
content : | ||
id : string | ||
players : | ||
- #1 | ||
type : IA | ||
name : ai1 | ||
url : localhost:9999 | ||
difficulty : HARD | ||
- #2 | ||
type : IA | ||
name : ai2 | ||
url : localhost:9998 | ||
difficulty : HARD | ||
board : | ||
list : | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 1 | ||
- 0 | ||
- 0 | ||
- 0 | ||
- 0 | ||
- 0 | ||
- 0 | ||
- 0 | ||
- 0 | ||
- 0 | ||
- 0 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
- 3 | ||
whiteTurn : true | ||
status : OK | ||
|
||
delete : | ||
description : Delete game with game id. | ||
responses : | ||
204 : | ||
description : Game deleted. | ||
404 : | ||
description : Game not found. |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
post : | ||
description : Create player. | ||
body: | ||
application/json: | ||
type: PlayerLibrary.Player | ||
responses : | ||
204 : | ||
description : Player created. | ||
400 : | ||
description : Error in request. | ||
body: | ||
application/json: | ||
type: PlayerLibrary.PlayerResponse | ||
example : | ||
content : | ||
type : IA | ||
name : ia1 | ||
url : localhost:9999 | ||
difficulty : HARD | ||
status : NAME_PLAYER_NOT_AVAILABLE | ||
|
||
get : | ||
description : Get players. | ||
responses : | ||
200 : | ||
body: | ||
application/json: | ||
type: PlayerLibrary.PlayersResponse | ||
example : | ||
content : | ||
- #1 | ||
type : IA | ||
name : ia1 | ||
url : localhost:9999 | ||
difficulty : HARD | ||
- #2 | ||
type : IA | ||
name : ia2 | ||
url : localhost:9998 | ||
difficulty : HARD | ||
status : OK | ||
|
||
/{name} : | ||
get : | ||
description : Get player with name. | ||
responses : | ||
200 : | ||
body: | ||
application/json: | ||
type: PlayerLibrary.PlayerResponse | ||
example : | ||
content : | ||
type : IA | ||
name : ia1 | ||
url : localhost:9999 | ||
difficulty : HARD | ||
status : OK | ||
/{playerId} : | ||
delete : | ||
description : Get player with name. | ||
responses : | ||
204 : | ||
description : Player deleted. | ||
404 : | ||
description : Player not found. |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#%RAML 1.0 | ||
title: Iataaa | ||
version: v1.0 | ||
baseUri: /api | ||
mediaType: application/json | ||
|
||
uses: | ||
PlayerLibrary : types/playerLibrary.raml | ||
GameLibrary : types/gameLibrary.raml | ||
ResponseLibrary : types/responseLibrary.raml | ||
|
||
/games : !include endpoints/games.raml | ||
/players : !include endpoints/players.raml |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
raml2html iataaa.raml > ../index.html | ||
|
||
if [ $? -eq 0 ]; then | ||
nohup xdg-open ../index.html >/dev/null 2>&1 | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#%RAML 1.0 Library | ||
|
||
uses: | ||
PlayerLibrary : playerLibrary.raml | ||
ResponseLibrary : responseLibrary.raml | ||
|
||
types : | ||
|
||
Case : | ||
type : integer | ||
description: It's pawn code. 0 = EMPTY, 1 = BLACK PWAN, 2 = BLACK KING, 3 = WHITE PWAN and 4 = WHITE KING | ||
minimum: 0 | ||
maximum: 4 | ||
|
||
Board : | ||
type : object | ||
properties: | ||
list : Case[] | ||
|
||
GameStatus : | ||
type : object | ||
properties : | ||
id : string | ||
players : PlayerLibrary.Player[] | ||
board : Board | ||
whiteTurn : boolean | ||
|
||
GamePlayers : | ||
type : object | ||
properties : | ||
gameID : string | ||
players : | ||
type : string[] | ||
description : Players Names. | ||
example: | ||
gameID: aiGame | ||
players : | ||
- p1 | ||
- p2 | ||
|
||
# ------------------- | ||
# RESPONSE | ||
# ------------------- | ||
GamesStatusResponse : | ||
type : object | ||
properties: | ||
content : GameStatus | ||
status : ResponseLibrary.StatusType | ||
|
||
GamesNamesResponse : | ||
type : object | ||
properties: | ||
content : string[] | ||
status : ResponseLibrary.StatusType | ||
|
||
GamesPlayersResponse : | ||
type : object | ||
properties: | ||
content : GamePlayers[] | ||
status : ResponseLibrary.StatusType |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#%RAML 1.0 Library | ||
|
||
uses: | ||
ResponseLibrary : responseLibrary.raml | ||
|
||
types : | ||
PlayerType : | ||
enum: [IA, HUMAN] | ||
|
||
Difficulty : | ||
enum : [EASY, MEDIUM, HARD] | ||
|
||
Player : | ||
type : object | ||
properties : | ||
type : PlayerType | ||
name : string | ||
url : string | ||
difficulty : Difficulty | ||
example: | ||
type : IA | ||
name : ia1 | ||
url : localhost:9999 | ||
difficulty : HARD | ||
|
||
|
||
# ------------------- | ||
# RESPONSE | ||
# ------------------- | ||
PlayerResponse : | ||
type : object | ||
properties: | ||
content : Player | ||
status : ResponseLibrary.StatusType | ||
|
||
PlayersResponse : | ||
type : object | ||
properties: | ||
content : Player[] | ||
status : ResponseLibrary.StatusType |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#%RAML 1.0 Library | ||
|
||
types : | ||
StatusType : | ||
type : string | ||
enum : [ | ||
OK, | ||
ERROR, | ||
INVALIDE_ARGUMENT, | ||
PLAYERS_NO_FOUND, | ||
NAME_PLAYER_NOT_AVAILABLE, | ||
NAME_GAME_NOT_AVAILABLE, | ||
BUSY_IA | ||
] |
Oops, something went wrong.