upd: 编码规范
This commit is contained in:
@@ -2,6 +2,7 @@ package cn.odboy.config;
|
||||
|
||||
import cn.odboy.mapper.QuartzJobMapper;
|
||||
import cn.odboy.model.job.domain.QuartzJob;
|
||||
import cn.odboy.service.QuartzJobService;
|
||||
import cn.odboy.util.QuartzManage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
@@ -16,7 +17,7 @@ import java.util.List;
|
||||
@RequiredArgsConstructor
|
||||
public class JobRunner implements ApplicationRunner {
|
||||
private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
|
||||
private final QuartzJobMapper quartzJobMapper;
|
||||
private final QuartzJobService quartzJobService;
|
||||
private final QuartzManage quartzManage;
|
||||
|
||||
/**
|
||||
@@ -26,7 +27,7 @@ public class JobRunner implements ApplicationRunner {
|
||||
*/
|
||||
@Override
|
||||
public void run(ApplicationArguments applicationArguments) {
|
||||
List<QuartzJob> quartzJobs = quartzJobMapper.selectActiveJob();
|
||||
List<QuartzJob> quartzJobs = quartzJobService.listActiveJob();
|
||||
quartzJobs.forEach(quartzManage::addJob);
|
||||
log.info("Timing task injection complete");
|
||||
}
|
||||
|
||||
@@ -16,6 +16,4 @@ public interface QuartzJobMapper extends BaseMapper<QuartzJob> {
|
||||
IPage<QuartzJob> selectByPage(@Param("criteria") QuartzJobQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
List<QuartzJob> selectByPage(@Param("criteria") QuartzJobQueryCriteria criteria);
|
||||
|
||||
List<QuartzJob> selectActiveJob();
|
||||
}
|
||||
|
||||
@@ -109,4 +109,5 @@ public interface QuartzJobService extends IService<QuartzJob> {
|
||||
* @throws InterruptedException /
|
||||
*/
|
||||
void executionSubJob(String[] tasks) throws InterruptedException;
|
||||
List<QuartzJob> listActiveJob();
|
||||
}
|
||||
|
||||
@@ -134,6 +134,11 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QuartzJob> listActiveJob() {
|
||||
return lambdaQuery().eq(QuartzJob::getIsPause, 0).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<QuartzJob> quartzJobs, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
|
||||
@@ -15,10 +15,4 @@
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectPauseJob" resultType="cn.odboy.model.job.domain.QuartzJob">
|
||||
SELECT *
|
||||
FROM sys_quartz_job
|
||||
WHERE is_pause = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -18,5 +18,4 @@
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user