UserController.java 934 B

1234567891011121314151617181920212223242526
  1. package com.ym.controller;
  2. import com.ym.service.UserService;
  3. import io.rong.models.user.UserModel;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.RequestBody;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestMethod;
  8. import org.springframework.web.bind.annotation.RestController;
  9. @RestController
  10. @RequestMapping("/user")
  11. public class UserController {
  12. @Autowired
  13. UserService userService;
  14. @RequestMapping(value = "/register", method = RequestMethod.POST)
  15. public Object register(@RequestBody UserModel userModel) throws Exception {
  16. return userService.register(userModel);
  17. }
  18. @RequestMapping(value = "/update", method = RequestMethod.POST)
  19. public Object update(@RequestBody UserModel userModel) throws Exception {
  20. return userService.update(userModel);
  21. }
  22. }