添加简历列表接口
This commit is contained in:
@@ -24,7 +24,8 @@ offerpie/back-end
|
||||
│ │ ├─ RouteMenuController.java # 路由菜单接口(获取用户有效菜单树)
|
||||
│ │ ├─ UserProfileController.java # 用户个人资料接口(主表+5张子表的查询与保存)
|
||||
│ │ ├─ JobIntentionController.java # 求职意向接口(查询与保存)
|
||||
│ │ └─ JobController.java # 岗位接口(岗位列表查询)
|
||||
│ │ ├─ JobController.java # 岗位接口(岗位列表查询)
|
||||
│ │ └─ UserResumeController.java # 用户简历接口(简历列表查询等)
|
||||
│ ├─ service/
|
||||
│ │ ├─ LoginService.java # 登录业务逻辑(验证码校验、自动注册、JWT生成、Cookie设置)
|
||||
│ │ ├─ UserRegisterService.java # 用户注册服务(注册逻辑、邀请码生成与绑定)
|
||||
@@ -33,6 +34,7 @@ offerpie/back-end
|
||||
│ │ ├─ UserProfileService.java # 用户个人资料服务(主表+5张子表的CRUD)
|
||||
│ │ ├─ JobIntentionService.java # 求职意向服务(查询与保存/更新)
|
||||
│ │ ├─ JobService.java # 岗位服务(岗位列表查询、匹配度计算编排)
|
||||
│ │ ├─ UserResumeService.java # 用户简历服务(简历列表查询等)
|
||||
│ │ └─ WxPayNotifyMessageAbstractImpl.java # 微信支付回调实现
|
||||
│ └─ pojo/
|
||||
│ ├─ param/
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.jiayunet.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.jiayunet.pojo.dto.resume.ResumeListItemDto;
|
||||
import org.jiayunet.service.UserResumeService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户简历接口
|
||||
* 提供简历列表查询等功能
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/resume")
|
||||
@AllArgsConstructor
|
||||
@Validated
|
||||
public class UserResumeController {
|
||||
|
||||
private UserResumeService userResumeService;
|
||||
|
||||
/**
|
||||
* 查询当前用户的简历列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<ResumeListItemDto> listResume() {
|
||||
return userResumeService.listResume().stream().map(po -> {
|
||||
ResumeListItemDto dto = new ResumeListItemDto();
|
||||
BeanUtils.copyProperties(po, dto);
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package org.jiayunet.pojo.dto.resume;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 简历列表项返回
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class ResumeListItemDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
/** 简历名称 */
|
||||
private String resumeName;
|
||||
|
||||
/** 目标岗位 */
|
||||
private String targetPosition;
|
||||
|
||||
/** 是否默认简历 0=否 1=是 */
|
||||
private Integer isDefault;
|
||||
|
||||
/** 简历整体修改时间 */
|
||||
private Instant updateTime;
|
||||
|
||||
/** 简历创建时间 */
|
||||
private Instant createTime;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.jiayunet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jiayunet.mapper.*;
|
||||
import org.jiayunet.pojo.po.*;
|
||||
import org.jiayunet.tool.UserSecurityTool;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户简历服务
|
||||
* <p>依赖:无</p>
|
||||
* <p>使用表:bg_user_resume(简历主表查询)</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class UserResumeService {
|
||||
|
||||
@Autowired
|
||||
private UserResumeMapper userResumeMapper;
|
||||
|
||||
/**
|
||||
* 查询当前用户的简历列表
|
||||
* <p>按sort_order升序、create_time降序排列</p>
|
||||
*/
|
||||
public List<UserResume> listResume() {
|
||||
Long userId = UserSecurityTool.getUserId();
|
||||
return userResumeMapper.selectList(new LambdaQueryWrapper<UserResume>()
|
||||
.eq(UserResume::getUserId, userId)
|
||||
.orderByAsc(UserResume::getSortOrder)
|
||||
.orderByDesc(UserResume::getCreateTime));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user