UserController.java 981 B

1234567891011121314151617181920212223242526272829
  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. /**
  10. * Created by weiqinxiao on 2019/2/25.
  11. */
  12. @RestController
  13. @RequestMapping("/user")
  14. public class UserController {
  15. @Autowired
  16. UserService userService;
  17. @RequestMapping(value = "/register", method = RequestMethod.POST)
  18. public Object register(@RequestBody UserModel userModel) throws Exception {
  19. return userService.register(userModel);
  20. }
  21. @RequestMapping(value = "/update", method = RequestMethod.POST)
  22. public Object update(@RequestBody UserModel userModel) throws Exception {
  23. return userService.update(userModel);
  24. }
  25. }