Current service represents logic to generate randomly defined amount of IMEI numbers some of them invalid and some of them duplicates. Service will validate IMEI numbers and will aggregate result to response JSON object also duplicated and valid values will be stared in the DB.
By the default service will start on port 8080
with few end point.
- Easy way to get result. Service will generate IMEIs and will validate automatically. Request needs one input parameter
amount
which represents initial amount of generated IMEIs.
curl --location --request GET 'http://localhost:8080/imei?amount=23' \
--data-raw ''
- Generate list of IMEIs with 20% of wrong and 20% of duplicates. Request needs one input parameter
amount
which represents initial amount of generated IMEIs.
curl --location --request GET 'http://localhost:8080/generate?amount=15' \
--data-raw ''
- Run IMEI validation
curl --location --request POST 'http://localhost:8080/imei' \
--header 'Content-Type: application/json' \
--data-raw '{
"input": []
}'
###To run service
./gradlew bootRun
##To Build service
./gradlew clean build
##Run tests
./gradlew test
###Project structure, packages:
controller
- web layer and end-point definitiondata
- presentation and DB data objectsrepository
- DB connection layerservice
- business logicutils
- validator and generator for IMEI
###Tech stack:
- Java 11
- Gradle
- MongoDB
- Lombok