WhitelistController.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package com.ym.controller;
  2. import com.ym.service.ChatroomService;
  3. import io.rong.models.chatroom.ChatroomModel;
  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("/whitelist")
  14. public class WhitelistController {
  15. @Autowired
  16. ChatroomService chatroomService;
  17. @RequestMapping(value = "/user/add", method = RequestMethod.POST)
  18. public Object userAdd(@RequestBody ChatroomModel chatroomModel) throws Exception {
  19. return chatroomService.whitelistUserAdd(chatroomModel);
  20. }
  21. @RequestMapping(value = "/user/remove", method = RequestMethod.POST)
  22. public Object userRemove(@RequestBody ChatroomModel chatroomModel) throws Exception {
  23. return chatroomService.whitelistUserRemove(chatroomModel);
  24. }
  25. @RequestMapping(value = "/user/getList", method = RequestMethod.POST)
  26. public Object userGetList(@RequestBody ChatroomModel chatroomModel) throws Exception {
  27. return chatroomService.whitelistUserGetList(chatroomModel);
  28. }
  29. @RequestMapping(value = "/message/add", method = RequestMethod.POST)
  30. public Object messageAdd(@RequestBody String[] objectNames) throws Exception {
  31. return chatroomService.whitelistMessageAdd(objectNames);
  32. }
  33. @RequestMapping(value = "/message/remove", method = RequestMethod.POST)
  34. public Object messageRemove(@RequestBody String[] objectNames) throws Exception {
  35. return chatroomService.whitelistMessageRemove(objectNames);
  36. }
  37. @RequestMapping(value = "/message/getList", method = RequestMethod.POST)
  38. public Object messageGetList() throws Exception {
  39. return chatroomService.whitelistMessageGetList();
  40. }
  41. }