UserController.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.ym.controller;
  2. import com.ym.common.ApiException;
  3. import com.ym.common.BaseResponse;
  4. import com.ym.mec.common.controller.BaseController;
  5. import com.ym.pojo.ReqUserData;
  6. import com.ym.service.UserService;
  7. import io.rong.models.user.UserModel;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.RequestBody;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RequestMethod;
  12. import org.springframework.web.bind.annotation.RestController;
  13. /**
  14. * Created by weiqinxiao on 2019/2/25.
  15. */
  16. @RestController
  17. @RequestMapping("/user")
  18. public class UserController {
  19. @Autowired
  20. UserService userService;
  21. @RequestMapping(value = "/register", method = RequestMethod.POST)
  22. public Object register(@RequestBody UserModel userModel) throws Exception {
  23. return userService.register(userModel);
  24. }
  25. @RequestMapping(value = "/update", method = RequestMethod.POST)
  26. public Object update(@RequestBody UserModel userModel) throws Exception {
  27. return userService.update(userModel);
  28. }
  29. }