Commit 0cba9cea by zwb

添加简历模块查询与删除简历

parent 3bdd2b77
...@@ -5,14 +5,17 @@ import com.bkty.system.domain.dto.ResumeListItemCache; ...@@ -5,14 +5,17 @@ import com.bkty.system.domain.dto.ResumeListItemCache;
import com.bkty.system.domain.dto.ResumeMakeDto; import com.bkty.system.domain.dto.ResumeMakeDto;
import com.bkty.system.domain.vo.ResumeVo; import com.bkty.system.domain.vo.ResumeVo;
import com.bkty.system.service.resume.NewEditionResumeService; import com.bkty.system.service.resume.NewEditionResumeService;
import com.bkty.system.service.resume.ResumeCacheService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.annotation.RepeatSubmit; import org.dromara.common.core.annotation.RepeatSubmit;
import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.R;
import org.dromara.common.core.domain.UserLoginInfo;
import org.dromara.common.core.exception.JxgException; import org.dromara.common.core.exception.JxgException;
import org.dromara.common.core.exception.WarnException; import org.dromara.common.core.exception.WarnException;
import org.dromara.common.core.utils.SecurityUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -33,6 +36,8 @@ public class NewEditionResumeController { ...@@ -33,6 +36,8 @@ public class NewEditionResumeController {
private final NewEditionResumeService newEditionResumeService; private final NewEditionResumeService newEditionResumeService;
private final ResumeCacheService resumeCacheService;
/** /**
* 新版导入简历 * 新版导入简历
* @param file 文件 * @param file 文件
...@@ -95,4 +100,26 @@ public class NewEditionResumeController { ...@@ -95,4 +100,26 @@ public class NewEditionResumeController {
List<ResumeListItemCache> result = this.newEditionResumeService.resumeList(userId); List<ResumeListItemCache> result = this.newEditionResumeService.resumeList(userId);
return new R<>(result); return new R<>(result);
} }
/**
* 删除简历
* @param dto
* @return
*/
@PostMapping("/del-resume")
@RepeatSubmit
public R<Void> delResume(@RequestBody ResumeMakeDto dto) {
if (null == dto.getResumeId()){
throw new JxgException("简历id不能为空");
}
this.newEditionResumeService.delResume(dto);
Long userId = 1L;
UserLoginInfo userLoginInfo = SecurityUtils.getUser();
if (userLoginInfo!=null){
userId = userLoginInfo.getId();
}
this.resumeCacheService.delResumeCache(Long.valueOf(dto.getResumeId()), userId);
return new R<>();
}
} }
...@@ -54,4 +54,10 @@ public interface NewEditionResumeService { ...@@ -54,4 +54,10 @@ public interface NewEditionResumeService {
* @return * @return
*/ */
List<ResumeListItemCache> resumeList(Long userId); List<ResumeListItemCache> resumeList(Long userId);
/**
* 删除简历
* @param dto
*/
void delResume(ResumeMakeDto dto) ;
} }
...@@ -644,4 +644,26 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService { ...@@ -644,4 +644,26 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService {
} }
return caches; return caches;
} }
@Override
public void delResume(ResumeMakeDto dto) {
Long userId = 1L;
UserLoginInfo userLoginInfo = SecurityUtils.getUser();
if (userLoginInfo!=null){
userId = userLoginInfo.getId();
}
String resumeKey = CacheConstants.REDIS_USER_RESUME_KEY.formatted(userId, dto.getResumeId());
redisTemplate.delete(resumeKey);
UpdateWrapper<FunctionResumeBase> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", dto.getResumeId()).set("is_deleted", true);
this.functionResumeBaseMapper.update(null, updateWrapper);
UpdateWrapper<FunctionResumeModel> updateWrapperModel = new UpdateWrapper<>();
updateWrapperModel.eq("resume_id", dto.getResumeId()).set("is_deleted", true);
this.resumeModelMapper.update(null, updateWrapperModel);
//this.resumeCacheService.refreshResumeListCache(this.baseMapper.queryResumeListV2(userId), userId);
this.resumeCacheService.delResumeListCache(userId);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment