1 本地数据库
本地数据库创建教程:
创建本地数据库user_data:
2 代码主体
2.1 Controller
文件名MyController,内容为:
@RestController
@RequestMapping("/homepage")
public class MyController {
@Resource
MyService myService;
@GetMapping("/learnSpringBoot")
public String learnController(@RequestParam("number") int number){
return myService.learnService(number);
}
}
2.2 Service
文件名MyService,内容为:
@Service
@EnableScheduling
public class MyService {
@Resource
MyMapper myMapper;
public String learnService(int number){
UserDTO res = myMapper.LearnMapper(number);
String name = res.getName();
Syst