UserController.java 760 B

123456789101112131415161718192021222324252627282930
  1. package com.bizmatics.controller.web;
  2. import com.bizmatics.model.User;
  3. import com.bizmatics.service.UserService;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.PostMapping;
  6. import org.springframework.web.bind.annotation.RequestBody;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RestController;
  9. /**
  10. *
  11. * 用户
  12. * @author ya
  13. * @since 2021-07-07
  14. */
  15. @RestController
  16. @RequestMapping("/user")
  17. public class UserController {
  18. @Autowired
  19. private UserService userService;
  20. @PostMapping("register")
  21. public void register(@RequestBody User user){
  22. userService.register(user);
  23. }
  24. }