sinanduman / courseapp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About Course App

V1

Aimed to show RestFul api structure using a Map object.

Map<String, Course>

Why key field is String at V1 because we wanted to generate UUID when inserting a course via POST method. But we couldn't use it because there is time contstraint at presentation.

EXAMPLES

GET METHOD

GET http://localhost:8080/course

GET http://localhost:8080/course/1

POST METHOD

POST http://localhost:8080/course
Content-Type: application/json

{"id": "3", "name": "Scala"}

DELETE METHOD

DELETE http://localhost:8080/course/2

V2

Aimed to show Restful api structure using h2 database.

Created a new Controller named ControllerV2 for v2 api.
Created CourseRepository class to access database objects on the fly.
Created CourseService class to take database result from the repository to present it to the controller.

EXAMPLES

GET METHOD

GET http://localhost:8080/v2/course

GET http://localhost:8080/v2/course/1

POST METHOD

POST http://localhost:8080/v2/course
Content-Type: application/json

{"name": "Haskell"}

POST http://localhost:8080/v2/course
Content-Type: application/json

{"name": "Elixir"}

DELETE METHOD

DELETE http://localhost:8080/v2/course/2

About


Languages

Language:Java 100.0%