$ mysql -u root -p
use your password and adjust it in Spring Boot application.properties
mysql> CREATE DATABASE book_database;
mysql> USE book_database;
mysql> CREATE TABLE book
(
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(60) NOT NULL,
autor varchar(100) NOT NULL,
iban int(30) NOT NULL,
status int (10) NOT NULL DEFAULT 1,
timestamp TIMESTAMP,
PRIMARY KEY (id)
);
-
mvn clean install
-
build project
Create (POST):
$ curl --data "name=testPost&autor=authPost&iban=1235" http://localhost:8080/books/add
Get all: http://localhost:8080/books/all
Get by id: http://localhost:8080/books/1
Delete by id:
curl -X DELETE http://localhost:8080/books/delete/1