Skip to content

Commit 26620b9

Browse files
committed
补充测试方法
1 parent 85676a1 commit 26620b9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Spring-Boot-Ehcache-Anno/src/main/java/com/example/ehcache/controller/StudentController.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ public StudentController(StudentService studentService) {
2020
this.studentService = studentService;
2121
}
2222

23+
@RequestMapping("/add")
24+
public String add(Student student){
25+
try {
26+
studentService.add(student);
27+
return "success";
28+
}catch (Exception e){
29+
e.printStackTrace();
30+
}
31+
return "false";
32+
}
33+
2334
@RequestMapping("/update")
2435
public String update(Student student){
2536
try {

Spring-Boot-Redis-Anno/src/main/java/com/example/redis/controller/StudentController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ public StudentController(StudentService studentService) {
2020
this.studentService = studentService;
2121
}
2222

23+
@RequestMapping("/add")
24+
public String add(Student student){
25+
try {
26+
studentService.add(student);
27+
return "success";
28+
}catch (Exception e){
29+
e.printStackTrace();
30+
}
31+
return "false";
32+
}
2333
@RequestMapping("/update")
2434
public String update(Student student){
2535
try {

0 commit comments

Comments
 (0)