RecruitmentController.java 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package com.hssx.ysofficial.controller;
  2. import com.hssx.ysofficial.service.RecruitmentService;
  3. import com.hssx.ysofficial.utility.HttpRespMsg;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import org.springframework.web.multipart.MultipartFile;
  9. /**
  10. * <p>
  11. * 前端控制器
  12. * </p>
  13. *
  14. * @author Reiskuchen
  15. * @since 2020-02-14
  16. */
  17. @RestController
  18. @RequestMapping("/recruitment")
  19. public class RecruitmentController {
  20. @Autowired
  21. private RecruitmentService recruitmentService;
  22. /**
  23. * 获取招聘信息列表
  24. */
  25. @RequestMapping("/list")
  26. public HttpRespMsg getRecruitmentList() {
  27. return recruitmentService.getRecruitmentList();
  28. }
  29. /**
  30. * 获取某个id的招聘信息
  31. * id 要获取的id
  32. */
  33. @RequestMapping("/get")
  34. public HttpRespMsg getRecruitment(@RequestParam Integer id) {
  35. return recruitmentService.getRecruitment(id);
  36. }
  37. /**
  38. * 删除招聘信息
  39. * id 要删除的招聘信息id
  40. */
  41. @RequestMapping("/delete")
  42. public HttpRespMsg deleteRecruitmentList(@RequestParam Integer id) {
  43. return recruitmentService.deleteRecruitmentList(id);
  44. }
  45. /**
  46. * 新增或修改招聘信息
  47. * id 修改时需要的id
  48. * title 标题
  49. * content 内容
  50. * file 图片
  51. */
  52. @RequestMapping("/insertOrUpdate")
  53. public HttpRespMsg editRecruitmentList(Integer id, @RequestParam String title, @RequestParam String content,
  54. MultipartFile file) {
  55. return recruitmentService.editRecruitmentList(id, title, content, file);
  56. }
  57. }