فهرست منبع

```
refactor(QualificationCertificateController, WebSiteController, WebSiteService, WebSiteServiceImpl): 更新控制器和服务方法- 在`QualificationCertificateController`中,为`findByPage`方法添加了`@Anonymous`注解。
- 将`save`和`update`方法中的`@RequestBody`替换为`@ModelAttribute`。- 在`WebSiteController`中新增了两个方法:`getRecruitmentInfoById`和`getDevelopmentHistory`,并添加了相应的`@ApiOperation`和`@Anonymous`注解。
- 在`WebSiteService`接口中新增了`getRecruitmentInfoById`和`getDevelopmentHistory`方法。
- 在`WebSiteServiceImpl`实现类中实现了上述新增的方法,并注入了`AboutDevelopmentHistoryMapper`。
```

nahida 8 ماه پیش
والد
کامیت
534b80a05d

+ 2 - 2
zksy-admin/src/main/java/com/zksy/web/controller/base/QualificationCertificateController.java

@@ -46,12 +46,12 @@ public class QualificationCertificateController {
     @PostMapping("/save")
     @ApiOperation(value = "荣誉资质保存")
     @Anonymous
-    public AjaxResult save(@RequestBody QualificationCertificate entity) {
+    public AjaxResult save(@ModelAttribute QualificationCertificate entity) {
         return AjaxResult.success(service.saveQualificationCertificate( entity));
     }
     @PostMapping("/update")
     @ApiOperation(value = "荣誉资质修改")
-    public AjaxResult update(@RequestBody QualificationCertificate entity) {
+    public AjaxResult update(@ModelAttribute QualificationCertificate entity) {
         return AjaxResult.success(service.updateQualificationCertificate(entity));
     }
     @PostMapping("/deleteBatch")

+ 16 - 0
zksy-admin/src/main/java/com/zksy/web/controller/base/WebSiteController.java

@@ -26,4 +26,20 @@ public class WebSiteController {
         return AjaxResult.success(webSiteService.getRecruitmentInfoByPage(pageRequest.getPageNum(), pageRequest.getPageSize()));
     }
 
+    @GetMapping("/getRecruitmentInfoById")
+    @ApiOperation("根据id获取招聘信息")
+    @Anonymous
+    public AjaxResult getRecruitmentInfoById(
+            String id
+    ) {
+        return AjaxResult.success(webSiteService.getRecruitmentInfoById(id));
+    }
+
+    @GetMapping("/getDevelopmentHistory")
+    @ApiOperation("获取发展历程")
+    @Anonymous
+    public AjaxResult getDevelopmentHistory() {
+        return AjaxResult.success(webSiteService.getDevelopmentHistory());
+    }
+
 }

+ 4 - 0
zksy-system/src/main/java/com/zksy/base/service/WebSiteService.java

@@ -1,6 +1,7 @@
 package com.zksy.base.service;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.base.domain.AboutDevelopmentHistory;
 import com.zksy.base.domain.SmartEmployment;
 
 import java.util.List;
@@ -9,4 +10,7 @@ public interface WebSiteService {
 
     Page<SmartEmployment> getRecruitmentInfoByPage(Integer pageNum, Integer pageSize);
 
+    SmartEmployment getRecruitmentInfoById(String id);
+
+    List<AboutDevelopmentHistory> getDevelopmentHistory();
 }

+ 19 - 0
zksy-system/src/main/java/com/zksy/base/service/impl/WebSiteServiceImpl.java

@@ -1,20 +1,39 @@
 package com.zksy.base.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.base.domain.AboutDevelopmentHistory;
 import com.zksy.base.domain.SmartEmployment;
+import com.zksy.base.mapper.AboutDevelopmentHistoryMapper;
 import com.zksy.base.mapper.SmartEmploymentMapper;
 import com.zksy.base.service.WebSiteService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class WebSiteServiceImpl implements WebSiteService {
     @Autowired
     private SmartEmploymentMapper smartEmploymentMapper;
+    @Autowired
+    private AboutDevelopmentHistoryMapper aboutDevelopmentHistoryMapper;
     @Override
     public Page<SmartEmployment> getRecruitmentInfoByPage(Integer pageNum, Integer pageSize) {
         Page<SmartEmployment> page = new Page<>(pageNum, pageSize);
         return smartEmploymentMapper.selectPage(page, Wrappers.emptyWrapper());
     }
+
+    @Override
+    public SmartEmployment getRecruitmentInfoById(String id) {
+        return smartEmploymentMapper.selectById(id);
+    }
+
+    @Override
+    public List<AboutDevelopmentHistory> getDevelopmentHistory() {
+        LambdaQueryWrapper<AboutDevelopmentHistory> wrapper = new LambdaQueryWrapper<>();
+        wrapper.orderByAsc(AboutDevelopmentHistory::getYear);
+        return aboutDevelopmentHistoryMapper.selectList(wrapper);
+    }
 }