RestrictProjectController.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package com.goafanti.business.controller;
  2. import com.goafanti.business.bo.InputRestrictProject;
  3. import com.goafanti.business.service.RestrictProjectService;
  4. import com.goafanti.common.bo.Result;
  5. import com.goafanti.common.controller.CertifyApiController;
  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. import javax.annotation.Resource;
  10. @RestController
  11. @RequestMapping("/api/restrict/Project")
  12. public class RestrictProjectController extends CertifyApiController {
  13. @Resource
  14. private RestrictProjectService restrictProjectService;
  15. /**
  16. * 添加限制项目
  17. */
  18. @RequestMapping(value = "/add", method = RequestMethod.POST)
  19. public Result add(InputRestrictProject in){
  20. Result res = res();
  21. return res.data(restrictProjectService.add(in));
  22. }
  23. /**
  24. * 限制项目列表
  25. * @param in
  26. * @return
  27. */
  28. @RequestMapping(value = "/list", method = RequestMethod.GET)
  29. public Result list(InputRestrictProject in){
  30. Result res = res();
  31. if (in.getUid()==null){
  32. return res.error(buildError("客户不能为空"));
  33. }
  34. return res.data(restrictProjectService.list(in));
  35. }
  36. /**
  37. * 限定项目修改
  38. * @param id 编号
  39. * @param type 0=移除,1=转交
  40. * @param takeAid 接受者
  41. */
  42. @RequestMapping(value ="/update",method = RequestMethod.POST)
  43. public Result update(Integer id,Integer type,String takeAid){
  44. Result res = res();
  45. return res.data(restrictProjectService.update(id,type,takeAid));
  46. }
  47. }