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