package com.jkcredit.info.query.task; import com.jkcredit.info.query.util.CookieUtil; import com.jkcredit.info.query.util.HttpUtil; import lombok.extern.slf4j.Slf4j; 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; /** * @author xusonglin * @version V1.0 **/ @Service @Slf4j @EnableAsync public class AsyncQuery { @Async("executor") public Future detailInfoQuery(String url) throws InterruptedException { String detailInfoContent = HttpUtil.doGet(url, CookieUtil.getAuthenticationCookie()); return new AsyncResult<>(detailInfoContent); } }