refactor(系统): 去掉注释的类
This commit is contained in:
parent
fdb74fc805
commit
899b80a1df
|
@ -1,31 +0,0 @@
|
||||||
|
|
||||||
//TODO 后续清理 (合并完没问题再清理)=====清理报告定时任务只有一个,cron表达式凌晨定时扫描
|
|
||||||
|
|
||||||
/*
|
|
||||||
package io.metersphere.project.job;
|
|
||||||
|
|
||||||
import io.metersphere.system.schedule.BaseScheduleJob;
|
|
||||||
import org.quartz.JobExecutionContext;
|
|
||||||
import org.quartz.JobKey;
|
|
||||||
import org.quartz.TriggerKey;
|
|
||||||
|
|
||||||
public class CleanUpReportJob extends BaseScheduleJob {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void businessExecute(JobExecutionContext context) {
|
|
||||||
//TODO 定时任务执行 清除报告 invokerReportServices
|
|
||||||
//serviceInvoker.invokeReportServices(projectId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JobKey getJobKey(String projectId) {
|
|
||||||
return new JobKey(projectId, CleanUpReportJob.class.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TriggerKey getTriggerKey(String projectId) {
|
|
||||||
return new TriggerKey(projectId, CleanUpReportJob.class.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
|
|
||||||
//TODO 后续清理(合并完没问题再清理)=====清理报告定时任务只有一个,cron表达式凌晨定时扫描 创建项目不再创建定时任务
|
|
||||||
/*
|
|
||||||
package io.metersphere.project.service;
|
|
||||||
|
|
||||||
import io.metersphere.project.job.CleanUpReportJob;
|
|
||||||
import io.metersphere.sdk.constants.ScheduleResourceType;
|
|
||||||
import io.metersphere.sdk.constants.ScheduleType;
|
|
||||||
import io.metersphere.system.domain.Schedule;
|
|
||||||
import io.metersphere.system.schedule.ScheduleService;
|
|
||||||
import io.metersphere.system.service.CreateProjectResourceService;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* @author wx
|
|
||||||
*//*
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class CreateApplicationResourceService implements CreateProjectResourceService {
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ScheduleService scheduleService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createResources(String projectId) {
|
|
||||||
//初始化清理报告定时任务
|
|
||||||
Schedule request = new Schedule();
|
|
||||||
request.setName("Clean Report Job");
|
|
||||||
request.setResourceId(projectId);
|
|
||||||
request.setKey(projectId);
|
|
||||||
request.setProjectId(projectId);
|
|
||||||
request.setEnable(true);
|
|
||||||
request.setCreateUser("admin");
|
|
||||||
request.setType(ScheduleType.CRON.name());
|
|
||||||
// 每天凌晨2点执行清理任务
|
|
||||||
request.setValue("0 0 2 * * ?");
|
|
||||||
request.setJob(CleanUpReportJob.class.getName());
|
|
||||||
request.setResourceType(ScheduleResourceType.CLEAN_REPORT.name());
|
|
||||||
scheduleService.addSchedule(request);
|
|
||||||
scheduleService.addOrUpdateCronJob(request,
|
|
||||||
CleanUpReportJob.getJobKey(projectId),
|
|
||||||
CleanUpReportJob.getTriggerKey(projectId),
|
|
||||||
CleanUpReportJob.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
package io.metersphere.project.controller;
|
|
||||||
|
|
||||||
import io.metersphere.project.service.CreateApplicationResourceService;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.junit.jupiter.api.MethodOrderer;
|
|
||||||
import org.junit.jupiter.api.Order;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
|
||||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment= SpringBootTest.WebEnvironment.RANDOM_PORT)
|
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
||||||
@AutoConfigureMockMvc
|
|
||||||
public class CreateApplicationResourceTests {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CreateApplicationResourceService resourceService;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
@Order(1)
|
|
||||||
public void testCleanupResource() throws Exception {
|
|
||||||
resourceService.createResources("test_project_id");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
Loading…
Reference in New Issue