Used Apache Ignite as DB Web Service(Play Framework) to allow CRUD operations.
SBT tool is used for the project building.
What is the project about: Mobile phone users communicate with network stations.
It should be possibility to add user profile, add existing user to cell, request users in particular cell.
- Docker Compose should be installed.
- The project is tested with Docker Compose version 1.15.0. How to install the right veriosn, check here
- In the root project directory
cd docker
docker-compose up
Two images will be downloaded from github and launched:
- turukin/ignite-ws
- apacheignite/ignite
- In the root project directory
cd docker
docker-compose -f docker-compose-dev.yml up
cd ../ignite-ws
sbt run
In this case, apacheignite/ignite container is started with option network_mode: host. WS is started locally, without docker container.
After starting the WS binds at port 9500
For POST operations Content-Type header param should be defined as application/json
Returns all users inside the specified cell
-
Request method: GET
-
Signature: /cellUsers/:cellId
-
Example:
- localhost:9500/cellUsers/123qwe
- localhost:9500/cellUsers/anotherCellId
Connets a specified user with a specified cell
-
Request method: POST
-
Signature: /addUserToCell
-
Example:
localhost:9500/addUserToCellRequest body:
{
"ctn" : " 79521112233",
"cellId" : "reallyNewCellID"
}
Adds new user profile
-
Request method: POST
-
Signature: /addUserProfile
-
Example:
localhost:9500/addUserProfileRequest body:
{
"ctn" : " 79521112299",
"name" : "new one user",
"email" : "[email protected]"
}
Adds mock data.
For 123qwe cellId:
{
"ctn": " 79231112233",
"name": "John",
"email": "[email protected]",
"activationDate": "2017-09-01 12:39:34"
},
{
"ctn": " 79234445588",
"name": "Alice",
"email": "[email protected]",
"activationDate": "2017-09-01 12:39:34"
}
For anotherCellId :
{
"ctn": " 79521112233",
"name": "Mark",
"email": "[email protected]",
"activationDate": "2017-09-01 12:39:34"
},
{
"ctn": " 79524445588",
"name": "Jane",
"email": "[email protected]",
"activationDate": "2017-09-01 12:39:34"
}
-
Request method: POST
-
Signature: /populateTestData
-
Example:
localhost:9500/populateTestData