qq_o_79
2018-04-27 12:42
控制器那里是怎么写的啊
他没说,无人知晓
@RestController public class UserController { private final UserRepository userRepository; @Autowired public UserController(UserRepository userRepository) { this.userRepository = userRepository; } @PostMapping("/person/user") public User save(@RequestParam String name){ User user = new User(); user.setName(name); if(userRepository.save(user)){ System.out.printf("用户对象: %s 保存成功", user); } return user; } }
Spring Boot 2.0深度实践-初遇Spring Boot
75471 学习 · 212 问题
相似问题