SensitiveController.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.ym.controller;
  2. import com.ym.service.ChatroomService;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.web.bind.annotation.RequestBody;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestMethod;
  7. import org.springframework.web.bind.annotation.RestController;
  8. /**
  9. * Created by weiqinxiao on 2019/2/25.
  10. */
  11. @RestController
  12. @RequestMapping("/sensitive")
  13. public class SensitiveController {
  14. @Autowired
  15. ChatroomService chatroomService;
  16. @RequestMapping(value = "/add", method = RequestMethod.POST)
  17. public Object add(@RequestBody String word) throws Exception {
  18. return chatroomService.sensitiveAdd(word);
  19. }
  20. @RequestMapping(value = "/remove", method = RequestMethod.POST)
  21. public Object remove(@RequestBody String word) throws Exception {
  22. return chatroomService.sensitiveRemove(word);
  23. }
  24. @RequestMapping(value = "/getList", method = RequestMethod.POST)
  25. public Object getList() throws Exception {
  26. return chatroomService.sensitiveGetList();
  27. }
  28. }