添加 判断当前用户是否还能创建简历
This commit is contained in:
@@ -30,6 +30,12 @@ public class UserResumeController {
|
|||||||
|
|
||||||
// ==================== 简历列表 ====================
|
// ==================== 简历列表 ====================
|
||||||
|
|
||||||
|
/** 判断当前用户是否还能创建简历 */
|
||||||
|
@GetMapping("/canCreate")
|
||||||
|
public boolean canCreateResume() {
|
||||||
|
return userResumeService.canCreateResume();
|
||||||
|
}
|
||||||
|
|
||||||
/** 查询当前用户的简历列表 */
|
/** 查询当前用户的简历列表 */
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public List<ResumeListItemDto> listResume() {
|
public List<ResumeListItemDto> listResume() {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.jiayunet.mapper.*;
|
|||||||
import org.jiayunet.pojo.po.*;
|
import org.jiayunet.pojo.po.*;
|
||||||
import org.jiayunet.tool.UserSecurityTool;
|
import org.jiayunet.tool.UserSecurityTool;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@@ -32,6 +33,9 @@ public class UserResumeService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UserResumeMapper userResumeMapper;
|
private UserResumeMapper userResumeMapper;
|
||||||
|
|
||||||
|
@Value("${app.resume.max-count:5}")
|
||||||
|
private int maxResumeCount;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserResumeEducationMapper educationMapper;
|
private UserResumeEducationMapper educationMapper;
|
||||||
|
|
||||||
@@ -49,6 +53,16 @@ public class UserResumeService {
|
|||||||
|
|
||||||
// ==================== 简历列表 ====================
|
// ==================== 简历列表 ====================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前用户是否还能创建简历
|
||||||
|
* <p>统计用户已有简历数量,与配置的最大数量比较</p>
|
||||||
|
*/
|
||||||
|
public boolean canCreateResume() {
|
||||||
|
Long userId = UserSecurityTool.getUserId();
|
||||||
|
Long count = userResumeMapper.selectCount(new LambdaQueryWrapper<UserResume>().eq(UserResume::getUserId, userId));
|
||||||
|
return count < maxResumeCount;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前用户的简历列表
|
* 查询当前用户的简历列表
|
||||||
* <p>按sort_order升序、create_time降序排列</p>
|
* <p>按sort_order升序、create_time降序排列</p>
|
||||||
|
|||||||
@@ -75,6 +75,11 @@ app:
|
|||||||
ignore:
|
ignore:
|
||||||
urls: "/public/**,/job/list,/job/detail"
|
urls: "/public/**,/job/list,/job/detail"
|
||||||
|
|
||||||
|
# 简历配置
|
||||||
|
resume:
|
||||||
|
# 非会员最大限制数量
|
||||||
|
max-count: 5
|
||||||
|
|
||||||
# AI 多供应商配置,第一个为默认 provider
|
# AI 多供应商配置,第一个为默认 provider
|
||||||
# base-url 配到版本路径,如 DeepSeek: https://api.deepseek.com/v1,豆包: https://ark.cn-beijing.volces.com/api/v3
|
# base-url 配到版本路径,如 DeepSeek: https://api.deepseek.com/v1,豆包: https://ark.cn-beijing.volces.com/api/v3
|
||||||
ai:
|
ai:
|
||||||
|
|||||||
Reference in New Issue
Block a user