添加岗位总数接口

This commit is contained in:
zk
2026-07-13 16:53:19 +08:00
parent 9e7897332b
commit 283fb16816
2 changed files with 16 additions and 0 deletions
@@ -170,6 +170,15 @@ public class JobController {
return jobService.recommendJobs(param, userId); return jobService.recommendJobs(param, userId);
} }
/**
* 有效岗位总数统计
* <p>统计当前上架(status=0)的岗位数量,接口允许不登录访问</p>
*/
@GetMapping("/count")
public Long countValidJobs() {
return jobService.countValidJobs();
}
/** /**
* 根据岗位来源地址查询岗位信息 * 根据岗位来源地址查询岗位信息
* <p>通过岗位的原始链接(如招聘网站URL)查询对应的岗位信息</p> * <p>通过岗位的原始链接(如招聘网站URL)查询对应的岗位信息</p>
@@ -565,6 +565,13 @@ public class JobService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
/**
* 统计有效岗位总数(status=0)
*/
public Long countValidJobs() {
return jobMapper.selectCount(new LambdaQueryWrapper<Job>().eq(Job::getStatus, 0));
}
/** /**
* 收藏统计 * 收藏统计
* <p>方法逻辑流程:</p> * <p>方法逻辑流程:</p>