package com.hssx.ysofficial.controller; import com.hssx.ysofficial.service.RecruitmentService; import com.hssx.ysofficial.utility.HttpRespMsg; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; /** *
* 前端控制器 *
* * @author Reiskuchen * @since 2020-02-14 */ @RestController @RequestMapping("/recruitment") public class RecruitmentController { @Autowired private RecruitmentService recruitmentService; /** * 获取招聘信息列表 */ @RequestMapping("/list") public HttpRespMsg getRecruitmentList() { return recruitmentService.getRecruitmentList(); } /** * 获取某个id的招聘信息 * id 要获取的id */ @RequestMapping("/get") public HttpRespMsg getRecruitment(@RequestParam Integer id) { return recruitmentService.getRecruitment(id); } /** * 删除招聘信息 * id 要删除的招聘信息id */ @RequestMapping("/delete") public HttpRespMsg deleteRecruitmentList(@RequestParam Integer id) { return recruitmentService.deleteRecruitmentList(id); } /** * 新增或修改招聘信息 * id 修改时需要的id * title 标题 * content 内容 * file 图片 */ @RequestMapping("/insertOrUpdate") public HttpRespMsg editRecruitmentList(Integer id, @RequestParam String title, @RequestParam String content, MultipartFile file) { return recruitmentService.editRecruitmentList(id, title, content, file); } }