Spring Boot - Request Handling - π§ͺ Exercise: CustomerPlus API β Multiple Request Styles and Structured Response #198
akash-coded
started this conversation in
Tasks
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
π§ͺ Exercise:
CustomerPlus APIβ Multiple Request Styles and Structured Responseπ― Objective
Build a Spring Boot REST API that:
@RequestBody,@RequestParam,@PathVariable)π Project Setup
π Folder Structure
π§Ύ Step-by-Step Instructions
1οΈβ£ Add Dependencies in
pom.xml2οΈβ£
application.properties3οΈβ£ Model:
Customer.java4οΈβ£ DTO:
CustomerDTO.java5οΈβ£ Repository
6οΈβ£ Service Interface & Impl
7οΈβ£ Controller: Multiple Input Styles
8οΈβ£ Bonus:
ApiResponse.javaUtility Wrapper (optional)π§ͺ Test Cases with Postman (Manually or Auto Test)
POST
/api/v2/customersBody:
{ "name": "Ravi", "email": "[email protected]", "city": "Bangalore", "age": 29 }POST
/api/v2/customers/quick?name=Mini&[email protected]GET
/api/v2/customers/1GET
/api/v2/customers?city=Bangaloreπ‘ Learning Takeaways
@RequestBody,@RequestParam,@PathVariableBeta Was this translation helpful? Give feedback.
All reactions