V:ititit111222333
架構
public class StuController {app
@Autowiredide
private StuService stuService;spa
@GetMapping("get-by-id/{id}")orm
private Stu getById(@PathVariable("id") int id) {get
return stuService.getById(id);it
}class
@GetMapping("insert-by-stu")date
private Integer insertByStu() {di
Stu stu1 = new Stu();
stu1.setAge(1);
stu1.setName("我");
return stuService.insertByStu(stu1);
}
@GetMapping("update-by-stu")
private Integer updateByStu() {
Stu stu1 = new Stu();
stu1.setId(1211);
stu1.setAge(1);
stu1.setName("我");
return stuService.updateByStu(stu1);
}
@GetMapping("delete-by-id/{id}")
private Integer updateByStu(@PathVariable("id") int id) {
return stuService.deleteById(id);
}
}