- Rest APIs
- Three layers
- Define 1-to-1 relationship
- Define 1-to-many relationship
- Define many-to-many relationship
- Create Indexes
- Create unique key constraints
Pull the code and change the database connection properties in application.properties file
curl --location --request POST 'http://localhost:8080/v1/students' \
--header 'Content-Type: application/json' \
--data-raw '{
"firstName": "Simon",
"lastName": "Sinek",
"email": "simon.sinek@gmail.com",
"age": 55,
"books": [
{
"bookName": "Introduction To JAVA"
},
{
"bookName": "Angular for Dummies"
}
]
}'
curl --location --request GET 'http://localhost:8080/v1/students'
curl --location --request GET 'http://localhost:8080/v1/students?age=20'
curl --location --request POST 'http://localhost:8080/v1/books' \
--header 'Content-Type: application/json' \
--data-raw '{
"bookName": "HTML in 24 Hours",
"student": {
"id": 1
}
}'
curl --location --request POST 'http://localhost:8080/v1/students/1/student-id-card' \
--header 'Content-Type: application/json' \
--data-raw '{
"cardNumber": "123-456-7890"
}'
curl --location --request GET 'http://localhost:8080/v1/students/1'
curl --location --request POST 'http://localhost:8080/v1/courses' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Spring Boot with JPA",
"department": "IT"
}'
curl --location --request GET 'http://localhost:8080/v1/courses'
curl --location --request GET 'http://localhost:8080/v1/courses?name=JAVA'
curl --location --request POST 'http://localhost:8080/v1/enrolments' \
--header 'Content-Type: application/json' \
--data-raw '{
"studentId": 1,
"courseId": 1
}'
curl --location --request GET 'http://localhost:8080/v1/enrolments/courses/1'
curl --location --request GET 'http://localhost:8080/v1/enrolments/students/1'
