Browse Source

招聘信息后台增删改查3

Reiskuchen 5 years ago
parent
commit
7d9cfa7f4a

+ 9 - 0
official_backend/src/main/java/com/hssx/ysofficial/controller/RecruitmentController.java

@@ -31,6 +31,15 @@ public class RecruitmentController {
         return recruitmentService.getRecruitmentList();
     }
 
+    /**
+     * 获取某个id的招聘信息
+     * id 要获取的id
+     */
+    @RequestMapping("/get")
+    public HttpRespMsg getRecruitment(@RequestParam Integer id) {
+        return recruitmentService.getRecruitment(id);
+    }
+
     /**
      * 删除招聘信息
      * id 要删除的招聘信息id

+ 2 - 0
official_backend/src/main/java/com/hssx/ysofficial/service/RecruitmentService.java

@@ -16,6 +16,8 @@ import org.springframework.web.multipart.MultipartFile;
 public interface RecruitmentService extends IService<Recruitment> {
     HttpRespMsg getRecruitmentList();
 
+    HttpRespMsg getRecruitment(Integer id);
+
     HttpRespMsg deleteRecruitmentList(Integer id);
 
     HttpRespMsg editRecruitmentList(Integer id, String title, String content, String date, MultipartFile file);

+ 7 - 0
official_backend/src/main/java/com/hssx/ysofficial/service/impl/RecruitmentServiceImpl.java

@@ -40,6 +40,13 @@ public class RecruitmentServiceImpl extends ServiceImpl<RecruitmentMapper, Recru
         return httpRespMsg;
     }
 
+    @Override
+    public HttpRespMsg getRecruitment(Integer id) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.data = recruitmentMapper.selectById(id);
+        return httpRespMsg;
+    }
+
     @Override
     public HttpRespMsg deleteRecruitmentList(Integer id) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();