소스 검색

1、优化获得招聘会白名单企业接口

rayson 8 달 전
부모
커밋
c545dd709d

+ 6 - 2
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/controller/admin/fair/FairController.java

@@ -1,6 +1,7 @@
 package com.citu.module.menduner.system.controller.admin.fair;
 
 
+import cn.hutool.core.util.ObjectUtil;
 import com.citu.framework.apilog.core.annotation.ApiAccessLog;
 import com.citu.framework.common.pojo.CommonResult;
 import com.citu.framework.common.pojo.PageParam;
@@ -104,11 +105,14 @@ public class FairController {
 
     @GetMapping("/get-white-enterprise")
     @Operation(summary = "获得招聘会白名单企业")
-    public CommonResult<Map<String,Object>> getWhiteListByFairId() {
+    public CommonResult<Map<String, Object>> getWhiteListByFairId() {
         List<Long> enterpriseIds = fairService.getWhiteListByFairId(1L);
+        if (ObjectUtil.isEmpty(enterpriseIds)) {
+            return success(null);
+        }
         List<EnterpriseDO> enterpriseList = enterpriseMapper.selectBatchIds(enterpriseIds);
         List<EnterpriseRespVO> respList = BeanUtils.toBean(enterpriseList, EnterpriseRespVO.class);
-        Map<String,Object> map=new HashMap<>();
+        Map<String, Object> map = new HashMap<>();
         map.put("fair", fairService.getJobFair(1L));
         map.put("enterpriseList", respList);
         return success(map);