CooperationsController.java 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package com.hssx.ysofficial.controller;
  2. import com.hssx.ysofficial.entity.Cooperations;
  3. import com.hssx.ysofficial.mapper.CooperationsMapper;
  4. import com.hssx.ysofficial.service.CooperationsService;
  5. import com.hssx.ysofficial.utility.HttpRespMsg;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RequestParam;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import org.springframework.web.multipart.MultipartFile;
  11. import javax.annotation.Resource;
  12. /**
  13. * <p>
  14. * the cooperations of client company and high school 前端控制器
  15. * </p>
  16. *
  17. * @author Reiskuchen
  18. * @since 2019-10-14
  19. */
  20. @RestController
  21. @RequestMapping("/cooperations")
  22. public class CooperationsController {
  23. @Autowired
  24. private CooperationsService cooperationsService;
  25. @RequestMapping("/getCooperations")
  26. public HttpRespMsg getCooperation(){
  27. return cooperationsService.getCooperations();
  28. }
  29. /**
  30. * 添加合作者
  31. * name 合作者名称
  32. * description 合作者描述
  33. * type 合作者种类 0-联合开发 1-材料供应商 2-芯片及PCB版合作伙伴 3-软件合作伙伴 4-投融资服务机构
  34. * multipartFile 合作者图片
  35. */
  36. @RequestMapping("/addCooperation")
  37. public HttpRespMsg addCooperation(
  38. Cooperations cooperations,
  39. MultipartFile multipartFile){
  40. return cooperationsService.addCooperations(cooperations, multipartFile);
  41. }
  42. @RequestMapping("/deleteCooperation")
  43. public HttpRespMsg deleteCooperation(Integer id){
  44. return cooperationsService.deleteCooperationsById(id);
  45. }
  46. @RequestMapping("/editCooperation")
  47. public HttpRespMsg editCooperation(
  48. Cooperations cooperations,
  49. MultipartFile multipartFile){
  50. return cooperationsService.editCooperations(cooperations, multipartFile);
  51. }
  52. @RequestMapping("/switchCooperationSticky")
  53. public HttpRespMsg switchCooperationSticky(Integer id){
  54. return cooperationsService.switchCooperationSticky(id);
  55. }
  56. }