fix: ASW-119 调整 playbook job 执行成功后 pcap name
This commit is contained in:
@@ -8,6 +8,8 @@ import cn.hutool.log.Log;
|
||||
import net.geedge.asw.common.util.Constants;
|
||||
import net.geedge.asw.common.util.RCode;
|
||||
import net.geedge.asw.common.util.T;
|
||||
import net.geedge.asw.module.app.entity.PackageEntity;
|
||||
import net.geedge.asw.module.app.service.IPackageService;
|
||||
import net.geedge.asw.module.environment.entity.EnvironmentEntity;
|
||||
import net.geedge.asw.module.environment.service.IEnvironmentService;
|
||||
import net.geedge.asw.module.runner.entity.JobEntity;
|
||||
@@ -31,6 +33,7 @@ import java.util.Set;
|
||||
|
||||
|
||||
@DisallowConcurrentExecution
|
||||
@SuppressWarnings("all")
|
||||
public class JobPlaybookExecResultChecker extends QuartzJobBean {
|
||||
private static final Log log = Log.get();
|
||||
|
||||
@@ -43,6 +46,9 @@ public class JobPlaybookExecResultChecker extends QuartzJobBean {
|
||||
@Autowired
|
||||
private IJobService jobService;
|
||||
|
||||
@Autowired
|
||||
private IPackageService packageService;
|
||||
|
||||
@Override
|
||||
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
|
||||
|
||||
@@ -88,7 +94,9 @@ public class JobPlaybookExecResultChecker extends QuartzJobBean {
|
||||
// file
|
||||
if (MediaType.APPLICATION_OCTET_STREAM_VALUE.equals(response.header(Header.CONTENT_TYPE.getValue()))) {
|
||||
|
||||
String fileName = response.header(Header.CONTENT_DISPOSITION).split("filename=")[1];
|
||||
PackageEntity packageEntity = packageService.getById(job.getPackageId());
|
||||
// pcap name {package.name}-job-{jobId[0:8]}.pcap
|
||||
String fileName = T.StrUtil.concat(true, packageEntity.getName(), T.StrUtil.DASHED, "job", T.StrUtil.DASHED , T.StrUtil.sub(jobId, 0, 8), ".pcap");
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("[playbookExecResultChecker] [env: {}] [result fileName: {}]", environment.getId(), fileName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user