package cn.cslg.pas.service;


import cn.cslg.pas.domain.WebConfig;
import cn.cslg.pas.domain.WebTask;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class webImportService {
    private final WebConfigService webConfigService;
    private final WebTaskService webTaskService;
    /**
     *
     * @param id
     */
  public void importWebSource(Integer id,String conditions){
      //获得网站配置
      WebConfig webConfig = webConfigService.getConfigById(id);
      //新建任务
      WebTask webTask =new WebTask();
      webTask.setWebId(id);
      webTask.setTaskProcess(0.0);
      webTask.setSearchCondition(conditions);
      webTask.setTaskState(0);
      webTaskService.addWebTask(webTask);
  }


}
