feat: change jobname when export job

This commit is contained in:
tjq 2023-03-05 12:57:15 +08:00
parent d45cb0712c
commit 40192486c5
2 changed files with 9 additions and 5 deletions

View File

@ -221,6 +221,7 @@ public class JobServiceImpl implements JobService {
final JobInfoDO jobInfoDO = jobInfoOpt.get();
final SaveJobInfoRequest saveJobInfoRequest = JobConverter.convertJobInfoDO2SaveJobInfoRequest(jobInfoDO);
saveJobInfoRequest.setId(null);
saveJobInfoRequest.setJobName(saveJobInfoRequest.getJobName() + "_EXPORT_" + System.currentTimeMillis());
log.info("[Job-{}] [exportJob] jobInfoDO: {}, saveJobInfoRequest: {}", jobId, JsonUtils.toJSONString(jobInfoDO), JsonUtils.toJSONString(saveJobInfoRequest));
return saveJobInfoRequest;
}

View File

@ -1,7 +1,7 @@
package tech.powerjob.server.config;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import lombok.RequiredArgsConstructor;
@ -32,15 +32,18 @@ public class SwaggerConfig {
@Bean
public OpenAPI springShopOpenAPI() {
final Contact contact = new Contact();
contact.setName("Team PowerJob");
contact.setUrl("http://www.powerjob.tech");
contact.setEmail("tengjiqi@gmail.com");
// apiInfo()用来创建该Api的基本信息这些基本信息会展现在文档页面中
return new OpenAPI()
.info(new Info().title("PowerJob")
.description("Distributed scheduling and computing framework.")
.version(serverInfoService.fetchServiceInfo().getVersion())
.license(new License().name("Apache License 2.0").url("https://github.com/PowerJob/PowerJob/blob/master/LICENSE")))
.externalDocs(new ExternalDocumentation()
.description("Distributed scheduling and computing framework.")
.url("http://www.powerjob.tech/"));
.contact(contact)
.license(new License().name("Apache License 2.0").url("https://github.com/PowerJob/PowerJob/blob/master/LICENSE")));
}
@Bean