This project will show how to use lombok, custom-validation, exception handling
Explained how to use lombok features.
Created custom annotation for field validation.
How to handle exception by creating custom exception class, @ExceptionHandler and class level annotation @RestControllerAdvice.
How to convert from entity to dto and vice versa.
Used In memory H2 Database
To access H2 DB console
Person Api:
Employee Api:
Person Message:
{
"index": 1001,
"name": "Mahesh Kawali",
"isActive": false,
"registered": "2022-12-23T04:46:15+0000",
"age": 32,
"gender": "male",
"eyeColor": "blue",
"favoriteFruit": "apple",
"company": {
"title": "Chandra",
"email": "[email protected]",
"phone": "+919495683470",
"location": {
"country": "India",
"address": "15 Borivali Mumbai"
}
},
"tags": [
"Hotel",
"Business",
"Entrepreneur",
"Dhaba"
]
}
Employee Message:
{
"firstName":"Mahesh",
"lastName":"Kawali",
"doj":"07-04-2020",
"dept":"Software",
"email":"[email protected]",
"mobile":"9988776655",
"gender":"male",
"age":32,
"aboutMe":"I am software engineer",
"nationality":"Indian"
}