com.wuyu.module.hunter.async.AsyncResumeService Maven / Gradle / Ivy
package com.wuyu.module.hunter.async;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.github.dennisit.vplus.data.enums.common.EnableEnum;
import com.wuyu.module.hunter.entity.Resume;
import com.wuyu.module.hunter.service.IResumeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Service;
import java.util.concurrent.Future;
@Slf4j
@Service
@EnableAsync
public class AsyncResumeService {
@Autowired
private IResumeService resumeService;
@Async
public Future selectByUserId(long userId){
EntityWrapper wp = new EntityWrapper<>();
wp.eq("user_id", userId).eq("enabled", EnableEnum.ENABLED.getValue());
Resume resume = resumeService.selectOne(wp);
return new AsyncResult<>(resume);
}
}