Update ProjectService.java

格式化代码
This commit is contained in:
John Bro 2022-06-21 15:22:10 +08:00
parent b08015c711
commit fd47c7636c
1 changed files with 27 additions and 22 deletions

View File

@ -1015,7 +1015,8 @@ public class ProjectService {
}
// 删除 UI 报告产生的截图
public void cleanUpUiReportImg(){
public void cleanUpUiReportImg() {
try {
// 属于定时任务删除调试报告情况
// 获取昨天的当前时间
Date backupTime = org.apache.commons.lang3.time.DateUtils.addDays(new Date(), -1);
@ -1025,8 +1026,8 @@ public class ProjectService {
.andExecuteTypeEqualTo(ExecuteType.Debug.name());
List<ApiScenarioReport> apiScenarioReports = apiScenarioReportMapper.selectByExample(example);
// 删除调试报告的截图
for(ApiScenarioReport apiScenarioReport : apiScenarioReports){
if(FileUtil.deleteDir(new File(FileUtils.UI_IMAGE_DIR + "/" + apiScenarioReport.getId()))){
for (ApiScenarioReport apiScenarioReport : apiScenarioReports) {
if (FileUtil.deleteDir(new File(FileUtils.UI_IMAGE_DIR + "/" + apiScenarioReport.getId()))) {
LogUtil.info("删除 UI 调试报告截图成功,报告 ID 为 " + apiScenarioReport.getId());
// 删除调试报告
@ -1041,6 +1042,10 @@ public class ProjectService {
apiScenarioReportMapper.deleteByPrimaryKey(apiScenarioReport.getId());
}
}
} catch (Exception e) {
LogUtil.error(e.getMessage(), e);
MSException.throwException(e.getMessage());
}
}
public void checkProjectIsRepeatable(String projectId) {