You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blog/Building RESTful CRUD API in springboot/index.md
+20-12Lines changed: 20 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -432,15 +432,15 @@ public ResponseEntity<ApiResponseDto<?>> deleteUser(int id) throws UserServiceLo
432
432
}
433
433
```
434
434
435
-
Note:
436
-
435
+
:::note
437
436
- The `@Service` annotation is used to indicate that a class is a service component in the Spring application context.
438
437
439
438
- The `@Component` annotation is a generic stereotype annotation used to indicate that a class is a Spring component. Components annotated with @Component are candidates for auto-detection when using Spring's component scanning feature.
440
439
441
440
- The `@Autowired` annotation is used to automatically inject dependencies into Spring-managed beans. When Spring encounters a bean annotated with @Autowired, it looks for other beans in the application context that match the type of the dependency and injects it.
442
441
443
442
- The `@Slf4j` annotation is not a standard Spring annotation but rather a Lombok annotation used for logging.
443
+
:::
444
444
445
445
## Step 8: Create controller
446
446
@@ -545,19 +545,27 @@ public class UserServiceExceptionHandler {
545
545
546
546
## Step 10: Run your application and test with postman/frontend😊.
547
547
548
-
Register user failed: User details invalid!<br/>
549
-
<imgsrc="./images/image03.png"><br/><br/>
548
+
Register user failed: User details invalid!
549
+
550
+
<imgsrc="./images/image03.png">
551
+
552
+
Register user successful
553
+
554
+
<imgsrc="./images/image04.png">
555
+
556
+
557
+
Retrieve all users
558
+
559
+
<imgsrc="./images/image05.png">
560
+
561
+
562
+
Update the details of John
550
563
551
-
Register user successful<br/>
552
-
<imgsrc="./images/image04.png"><br/><br/>
564
+
<imgsrc="./images/image06.png">
553
565
554
-
Retrieve all users<br/>
555
-
<imgsrc="./images/image05.png"><br/><br/>
556
566
557
-
Update the details of John<br/>
558
-
<imgsrc="./images/image06.png"><br/><br/>
567
+
Delete user john
559
568
560
-
Delete user john<br/>
561
-
<imgsrc="./images/image07.png"><br/><br/>
569
+
<imgsrc="./images/image07.png">
562
570
563
571
Hey guys, that’s it. We have successfully developed rest crud API for a user management system.
0 commit comments