Demo project
A marketing company needs a simple pluggable application with a RESTful interface in order to be able to check the prices for commercials on every registered TV channel
Local Properties
You should change com.tagsoft.demo.uploads.directory property. Set location to save JAR file on your local
Requests
-
Register new user
curl --location --request POST 'localhost:8080/v1/auth/register'
--header 'Content-Type: application/json'
--data-raw '{ "email":"[email protected]", "password":"Qwe123", "userName":"nikolayK" }'
-
Authorization
curl --location --request POST 'localhost:8080/v1/auth/authenticate'
--header 'Content-Type: application/json'
--data-raw '{ "email":"[email protected]", "password":"Qwe123" }'
-
Add channel (Only for ADMIN)
curl --location --request POST 'localhost:8080/v1/tv_channel?name=QATV'
--header 'Authorization: Bearer auth_token' \
-
Remove channel by name (Only for ADMIN)
curl --location --request DELETE 'localhost:8080/v1/tv_channel?name=QATV'
--header 'Authorization: Bearer auth_token' \
-
Upload JAR plugin (Only for ADMIN)
curl --location --request POST 'localhost:8080/v1/plugin/reload'
--header 'Authorization: Bearer auth_token'
--form 'file=@"/Users/nikolaykolodyazhnii/TAC/plugin_tv_channel-1.0-SNAPSHOT.jar"'
-
Get list of all channels (For ADMIN and USER)
curl --location --request POST 'localhost:8080/v1/tv_channel/list'
--header 'Authorization: Bearer auth_token'
--header 'Content-Type: application/json'
--data-raw '{ "duration": 40, "repetitionNumber": 221, "from": "2019-01-21T05:47:08", "to": "2019-01-23T05:47:08" }'
JAR plugin for testing are located in scr/main/resources/files/plugin_tv_channel-1.0-SNAPSHOT.jar