com.wuyu.module.hunter.async.AsyncRecruitInputService Maven / Gradle / Ivy
package com.wuyu.module.hunter.async;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.wuyu.module.hunter.entity.RecruitInput;
import com.wuyu.module.hunter.service.IRecruitInputService;
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 AsyncRecruitInputService {
@Autowired
private IRecruitInputService recruitInputService;
@Async
public Future selectRecruitInput(long userId, long recruitId){
EntityWrapper wp = new EntityWrapper<>();
wp.eq("resume_user_id", userId).eq("recruit_id", recruitId);
RecruitInput input = recruitInputService.selectOne(wp);
return new AsyncResult<>(input);
}
}