Skip to the content.

Welcome to spring-and-summer!

This is just a test SpringBoot application I created for experimentation (using Spring’s Quickstart Guide). Displays Jackson mapping, SpringBoot Web and basic CRUD actions using RESTful APIs.

Comments

There is no database needed to run, but it also means that data stored in the application will be wiped after use (consider simple file storage, or just jump to using database management with H2 and Spring Data dependencies). Adding unit testing are TODO actions currently.

Setup guide

Running the application

Endpoints

There are 4 notable endpoints present in this application.

GET /greet?name=NAME

Returns a greeting String with NAME (default is World). If NAME exists in the application system, then it returns a more descriptive message.

POST /saveEntity

Saves an Entity into the application. Entities are unique by NAME, hence if a new Entity with the same name is to be created, the application will reject it.

Format of JSON body:

{
    "name": String name,
    "age": INT age
}

PUT /updateBalance

Updates an Entity if it exists in the application currently. Only the balance of an Entity can be modified.

Format of JSON body:

{
    "name": String name,
    "balance": INT newBalance
}

DELETE /deleteEntity

Deletes an Entity if it exists in the application currently.

Format of JSON body:

{
    "name": String name
}

Screenshots of usage

Running on IntelliJ

Running on IntelliJ

Greeting message

Greeting message

Saving a new Entity

Saving a new Entity

Updating the balance of an Entity

Updating the balance of an Entity

Deleting an Entity

Deleting an Entity

Updating a non-existent Entity

Updating a non-existent Entity