nacos加入到项目当中
This commit is contained in:
parent
b12f37331d
commit
c1b73596cd
@ -30,7 +30,11 @@ spring:
|
||||
maxPoolPreparedStatementPerConnectionSize: 20
|
||||
useGlobalDataSourceStat: true
|
||||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
|
||||
|
||||
cloud:
|
||||
config:
|
||||
override-none: true
|
||||
allow-override: true
|
||||
override-system-properties: false
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
|
||||
@ -40,6 +40,14 @@
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<parent>
|
||||
|
||||
@ -4,6 +4,7 @@ import com.qc.soft.framework.basic.context.TenantContext;
|
||||
import com.qc.soft.framework.basic.enums.IBasicState;
|
||||
import com.qc.soft.framework.basic.exception.BasicException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -15,7 +16,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@Configuration
|
||||
@Import({GlobalResponseHandler.class, GlobalExceptionHandler.class})
|
||||
public class GlobalTenantInterceptor implements HandlerInterceptor {
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.qc.soft.framework.basic.config;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
@ -17,7 +18,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import javax.annotation.Resource;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.ZoneId;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
@Configuration
|
||||
@Slf4j
|
||||
@ -36,8 +39,11 @@ public class GlobalWebConfigurer implements WebMvcConfigurer {
|
||||
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
converters.add(new StringHttpMessageConverter(StandardCharsets.UTF_8));
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.setTimeZone(TimeZone.getTimeZone("GMT+08:00"));
|
||||
mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
|
||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true);
|
||||
mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
|
||||
converters.add(new MappingJackson2HttpMessageConverter(mapper));
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package com.qc.soft.framework.basic.context;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
public class ApplicationContextProvider {
|
||||
|
||||
|
||||
private static ApplicationContext context;
|
||||
|
||||
public static void setApplicationContext(ApplicationContext applicationContext) {
|
||||
context = applicationContext;
|
||||
}
|
||||
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public static <T> T getBean(Class<T> beanClass) {
|
||||
return context.getBean(beanClass);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.qc.soft.framework.basic.context;
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnClass(ApplicationContext.class)
|
||||
@Slf4j
|
||||
public class SpringContext implements ApplicationContextAware {
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
public SpringContext() {
|
||||
log.info("Spring application context registered successfully!!!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
ApplicationContextProvider.setApplicationContext(applicationContext);
|
||||
}
|
||||
|
||||
public ApplicationContext getContext() {
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
public <T> T getBean(Class<T> clazz) {
|
||||
return applicationContext.getBean(clazz);
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.qc.soft.deploy.ease.exception;
|
||||
package com.qc.soft.framework.basic.exception;
|
||||
|
||||
import com.qc.soft.framework.basic.entity.BasicResponseState;
|
||||
import com.qc.soft.framework.basic.exception.BasicException;
|
||||
@ -0,0 +1,20 @@
|
||||
package com.qc.soft.framework.basic.http;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@Configuration
|
||||
public class HttpAutoConfiguration {
|
||||
|
||||
|
||||
@Bean
|
||||
public RestTemplate restTemplate() {
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
|
||||
return restTemplate;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.qc.soft.framework.basic.redis;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONReader;
|
||||
import com.alibaba.fastjson2.JSONWriter;
|
||||
import com.alibaba.fastjson2.filter.Filter;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.data.redis.serializer.SerializationException;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* Redis使用FastJson序列化
|
||||
*/
|
||||
public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T> {
|
||||
public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
|
||||
|
||||
static final Filter AUTO_TYPE_FILTER = JSONReader.autoTypeFilter("com");
|
||||
|
||||
@Override
|
||||
public byte[] serialize(T t) throws SerializationException {
|
||||
if (t == null) {
|
||||
return new byte[0];
|
||||
}
|
||||
return JSON.toJSONString(t, JSONWriter.Feature.WriteClassName).getBytes(DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T deserialize(byte[] bytes) throws SerializationException {
|
||||
if (bytes == null || bytes.length <= 0) {
|
||||
return null;
|
||||
}
|
||||
String str = new String(bytes, DEFAULT_CHARSET);
|
||||
|
||||
return (T) JSON.parseObject(str, Object.class, AUTO_TYPE_FILTER);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package com.qc.soft.framework.basic.redis;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(name = "spring.redis.host", havingValue = "true")
|
||||
@Slf4j
|
||||
public class RedisAutoConfiguration {
|
||||
|
||||
public RedisAutoConfiguration() {
|
||||
log.info("Framework redis template registered successfully!!!");
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<String, Object> template = new RedisTemplate<>();
|
||||
template.setConnectionFactory(redisConnectionFactory);
|
||||
FastJson2JsonRedisSerializer<Object> serializer = new FastJson2JsonRedisSerializer<>();
|
||||
template.setDefaultSerializer(serializer);
|
||||
template.setValueSerializer(serializer);
|
||||
template.setKeySerializer(new StringRedisSerializer());
|
||||
template.setHashKeySerializer(new StringRedisSerializer());
|
||||
template.setHashValueSerializer(serializer);
|
||||
template.afterPropertiesSet();
|
||||
return template;
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,7 +2,7 @@ package com.qc.soft.framework.basic.utils;
|
||||
|
||||
import java.util.Base64;
|
||||
|
||||
public class BasicAuthUtils {
|
||||
public class Base64AuthUtils {
|
||||
|
||||
public static String encode(String userName, String password) {
|
||||
String auth = userName + ":" + password;
|
||||
@ -1,3 +0,0 @@
|
||||
artifactId=deploy-ease-basic
|
||||
groupId=com.qc.soft
|
||||
version=1.0-SNAPSHOT
|
||||
@ -1,21 +0,0 @@
|
||||
com\qc\soft\framework\basic\config\GlobalTenantInterceptor.class
|
||||
com\qc\soft\framework\basic\web\ApiResult.class
|
||||
com\qc\soft\framework\basic\entity\BasicResponseState$BasicResponseStateBuilder.class
|
||||
com\qc\soft\framework\basic\utils\DateUtils.class
|
||||
com\qc\soft\framework\basic\entity\BasicResponseState.class
|
||||
com\qc\soft\framework\basic\utils\StrUtils.class
|
||||
com\qc\soft\framework\basic\enums\JenkinsJobStatus.class
|
||||
com\qc\soft\framework\basic\utils\TemplateParamsBuildUtils.class
|
||||
com\qc\soft\framework\basic\utils\MapUtils.class
|
||||
com\qc\soft\framework\basic\context\TenantContext.class
|
||||
com\qc\soft\framework\basic\config\GlobalWebConfigurer.class
|
||||
com\qc\soft\framework\basic\utils\HttpUtils.class
|
||||
com\qc\soft\framework\basic\config\GlobalResponseHandler.class
|
||||
com\qc\soft\framework\basic\exception\BasicException.class
|
||||
com\qc\soft\framework\basic\utils\FileUtils.class
|
||||
com\qc\soft\framework\basic\utils\ProcessUtils.class
|
||||
com\qc\soft\framework\basic\config\GlobalExceptionHandler.class
|
||||
com\qc\soft\framework\basic\enums\IBasicState.class
|
||||
com\qc\soft\framework\basic\entity\BaseEntity.class
|
||||
com\qc\soft\framework\basic\utils\BasicAuthUtils.class
|
||||
com\qc\soft\framework\basic\web\ApiResult$ApiResultBuilder.class
|
||||
@ -1,19 +0,0 @@
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\context\TenantContext.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\config\GlobalTenantInterceptor.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\config\GlobalWebConfigurer.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\config\GlobalExceptionHandler.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\utils\HttpUtils.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\web\ApiResult.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\utils\DateUtils.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\utils\BasicAuthUtils.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\enums\IBasicState.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\entity\BasicResponseState.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\utils\FileUtils.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\utils\TemplateParamsBuildUtils.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\config\GlobalResponseHandler.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\enums\JenkinsJobStatus.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\utils\ProcessUtils.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\entity\BaseEntity.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\utils\StrUtils.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\exception\BasicException.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-basic\src\main\java\com\qc\soft\framework\basic\utils\MapUtils.java
|
||||
@ -4,10 +4,15 @@ import com.qc.soft.deploy.ease.interceptor.BusinessTenantInterceptor;
|
||||
import com.qc.soft.framework.basic.config.GlobalWebConfigurer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Configuration
|
||||
@Slf4j
|
||||
@AutoConfigureAfter(GlobalWebConfigurer.class)
|
||||
@ -20,5 +25,22 @@ public class BusinessWebConfigurer implements WebMvcConfigurer {
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(businessTenantInterceptor).addPathPatterns("/**");
|
||||
}
|
||||
//
|
||||
// @Bean
|
||||
// public RestTemplate restTemplate() {
|
||||
// RequestConfig requestConfig = RequestConfig.custom()
|
||||
// .setConnectTimeout(5000) // Connection timeout
|
||||
// .setSocketTimeout(5000) // Read timeout
|
||||
// .build();
|
||||
//
|
||||
// // Create HttpClient with the timeout settings
|
||||
// CloseableHttpClient httpClient = HttpClients.custom()
|
||||
// .setDefaultRequestConfig(requestConfig)
|
||||
// .build();
|
||||
//
|
||||
// // Use HttpClient in RestTemplate
|
||||
// HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
// return new RestTemplate(factory);
|
||||
// }
|
||||
|
||||
}
|
||||
@ -5,7 +5,7 @@ import com.qc.soft.deploy.ease.api.response.TenantResponse;
|
||||
import com.qc.soft.deploy.ease.context.TenantAdapterProcessContext;
|
||||
import com.qc.soft.deploy.ease.dto.TenantAdapterJarDTO;
|
||||
import com.qc.soft.deploy.ease.enums.BusinessState;
|
||||
import com.qc.soft.deploy.ease.exception.BusinessException;
|
||||
import com.qc.soft.framework.basic.exception.BusinessException;
|
||||
import com.qc.soft.deploy.ease.service.INacosService;
|
||||
import com.qc.soft.deploy.ease.service.ITenantService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
package com.qc.soft.deploy.ease.interceptor;
|
||||
|
||||
import com.qc.soft.deploy.ease.entity.Tenant;
|
||||
import com.qc.soft.deploy.ease.exception.BusinessException;
|
||||
import com.qc.soft.framework.basic.exception.BusinessException;
|
||||
import com.qc.soft.deploy.ease.repository.ITenantRepository;
|
||||
import com.qc.soft.deploy.ease.state.IBusinessState;
|
||||
import com.qc.soft.framework.basic.context.TenantContext;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ package com.qc.soft.deploy.ease.service.impl;
|
||||
import com.qc.soft.deploy.ease.api.response.DictionaryResponse;
|
||||
import com.qc.soft.deploy.ease.api.response.TenantDictionaryResponse;
|
||||
import com.qc.soft.deploy.ease.convert.response.DictionaryConvert;
|
||||
import com.qc.soft.deploy.ease.exception.BusinessException;
|
||||
import com.qc.soft.framework.basic.exception.BusinessException;
|
||||
import com.qc.soft.deploy.ease.repository.IDictionaryRepository;
|
||||
import com.qc.soft.deploy.ease.repository.ITenantDictionaryRepository;
|
||||
import com.qc.soft.deploy.ease.service.IDictionaryService;
|
||||
|
||||
@ -19,9 +19,5 @@ spring:
|
||||
data-id: deploy-ease-core.yml
|
||||
group: business
|
||||
refresh: false
|
||||
config:
|
||||
override-none: false
|
||||
allow-override: true
|
||||
override-system-properties: false
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
@ -62,7 +62,6 @@
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>${fastjson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
@ -102,10 +101,6 @@
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||
@ -114,6 +109,31 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.nacos</groupId>-->
|
||||
<!-- <artifactId>nacos-client</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.fasterxml.jackson.core</groupId>-->
|
||||
<!-- <artifactId>jackson-core</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.fasterxml.jackson.core</groupId>-->
|
||||
<!-- <artifactId>jackson-databind</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@ -1,15 +1,20 @@
|
||||
package com.qc.soft.deploy.ease.adapter;
|
||||
|
||||
import com.qc.soft.framework.basic.config.GlobalExceptionHandler;
|
||||
import com.qc.soft.framework.basic.config.GlobalResponseHandler;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@SpringBootConfiguration
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan("com.qc.soft.deploy.ease.*")
|
||||
@EnableFeignClients
|
||||
@EnableDiscoveryClient
|
||||
public class DeployEaseTenantAdapterApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package com.qc.soft.deploy.ease.adapter;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.config.AppConfig;
|
||||
import com.qc.soft.framework.basic.context.ApplicationContextProvider;
|
||||
import com.qc.soft.framework.basic.context.SpringContext;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
public class HttpClient {
|
||||
|
||||
private static final ApplicationContext context;
|
||||
|
||||
static {
|
||||
context = ApplicationContextProvider.getApplicationContext();
|
||||
}
|
||||
|
||||
public static <H extends HttpHeaders, T> T get(String url, H headers, Class<T> cls) {
|
||||
HttpEntity<String> entity = new HttpEntity<>(headers);
|
||||
ResponseEntity<T> response = getRestTemplate().exchange(url, HttpMethod.GET, entity, cls);
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
|
||||
private static RestTemplate getRestTemplate() {
|
||||
return context.getBean(RestTemplate.class);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,37 +1,106 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.JenkinsCrumbIssuerResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.HttpClient;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.ThirdPartyJenkinsCrumbResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.build.ThirdPartyJenkinsBuildResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job.ThirdPartyJenkinsJobDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.view.ThirdPartyJenkinsViewDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.view.ThirdPartyJenkinsResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.consts.JenkinsConstants;
|
||||
import com.qc.soft.deploy.ease.adapter.enums.BusinessState;
|
||||
import com.qc.soft.framework.basic.exception.BasicException;
|
||||
import com.qc.soft.framework.basic.utils.BasicAuthUtils;
|
||||
import com.qc.soft.framework.basic.exception.BusinessException;
|
||||
import com.qc.soft.framework.basic.utils.Base64AuthUtils;
|
||||
import com.qc.soft.framework.basic.utils.HttpUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.IdentityHashMap;
|
||||
|
||||
import static com.qc.soft.deploy.ease.adapter.consts.JenkinsConstants.REDIS_JENKINS_ORIGINAL_VIEW;
|
||||
import static com.qc.soft.deploy.ease.adapter.consts.JenkinsConstants.REDIS_JENKINS_ORIGINAL_VIEW_BUILD;
|
||||
import static com.qc.soft.deploy.ease.adapter.consts.JenkinsConstants.REDIS_JENKINS_ORIGINAL_VIEW_JOB;
|
||||
import static com.qc.soft.deploy.ease.adapter.consts.JenkinsConstants.REDIS_JENKINS_ORIGINAL_VIEW_JOB_DETAIL;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class JenkinsClientApi {
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
public JenkinsCrumbIssuerResponse getJenkinsCrumbIssue(String url, String username, String password) throws BasicException {
|
||||
public ThirdPartyJenkinsCrumbResponse getJenkinsCrumb(String url, String username, String password) throws BasicException {
|
||||
IdentityHashMap<String, String> header = new IdentityHashMap<>();
|
||||
header.put("Authorization", BasicAuthUtils.encode(username, password));
|
||||
JenkinsCrumbIssuerResponse jenkinsCrumbIssuerResponse = HttpUtils.cookieGet(url, header, JenkinsCrumbIssuerResponse.class);
|
||||
if (jenkinsCrumbIssuerResponse == null) {
|
||||
header.put("Authorization", Base64AuthUtils.encode(username, password));
|
||||
ThirdPartyJenkinsCrumbResponse thirdPartyJenkinsCrumbResponse = HttpUtils.cookieGet(url, header, ThirdPartyJenkinsCrumbResponse.class);
|
||||
if (thirdPartyJenkinsCrumbResponse == null) {
|
||||
log.error("Get jenkins crumb failed!");
|
||||
throw new BasicException(BusinessState.GET_JENKINS_CRUMB_FAILED);
|
||||
throw new BusinessException(BusinessState.GET_JENKINS_CRUMB_FAILED);
|
||||
}
|
||||
if (StringUtils.isEmpty(jenkinsCrumbIssuerResponse.getCrumb()) || StringUtils.isEmpty(jenkinsCrumbIssuerResponse.getCookie())) {
|
||||
log.error("Get jenkins crumb and cookie failed, response:{}!", JSON.toJSONString(jenkinsCrumbIssuerResponse));
|
||||
throw new BasicException(String.format("Get jenkins crumb and cookie failed, response %s!", JSON.toJSONString(jenkinsCrumbIssuerResponse)));
|
||||
if (StringUtils.isEmpty(thirdPartyJenkinsCrumbResponse.getCrumb()) || StringUtils.isEmpty(thirdPartyJenkinsCrumbResponse.getCookie())) {
|
||||
log.error("Get jenkins crumb and cookie failed, response:{}!", JSON.toJSONString(thirdPartyJenkinsCrumbResponse));
|
||||
throw new BusinessException(String.format("Get jenkins crumb and cookie failed, response %s!", JSON.toJSONString(thirdPartyJenkinsCrumbResponse)));
|
||||
}
|
||||
return jenkinsCrumbIssuerResponse;
|
||||
return thirdPartyJenkinsCrumbResponse;
|
||||
}
|
||||
|
||||
|
||||
public ThirdPartyJenkinsResponse getViews() {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", Base64AuthUtils.encode("admin", "3%(Lb5GN,M'Yk\\,)Dy\"*"));
|
||||
ThirdPartyJenkinsResponse jenkins = HttpClient.get(String.format(JenkinsConstants.JENKINS_VIEWS_API, "http://192.168.2.200:9096"), headers, ThirdPartyJenkinsResponse.class);
|
||||
redisTemplate.opsForValue().set(REDIS_JENKINS_ORIGINAL_VIEW, jenkins);
|
||||
return (ThirdPartyJenkinsResponse) redisTemplate.opsForValue().get(REDIS_JENKINS_ORIGINAL_VIEW);
|
||||
}
|
||||
|
||||
public ThirdPartyJenkinsViewDetailResponse jobs(String viewName) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", Base64AuthUtils.encode("admin", "3%(Lb5GN,M'Yk\\,)Dy\"*"));
|
||||
String urlFormat = StringUtils.isEmpty(viewName) ?
|
||||
String.format(JenkinsConstants.JENKINS_JOB_ALL_API, "http://192.168.2.200:9096") : String.format(JenkinsConstants.JENKINS_JOB_API, "http://192.168.2.200:9096", viewName);
|
||||
try {
|
||||
String redisKey = String.format(REDIS_JENKINS_ORIGINAL_VIEW_JOB, viewName);
|
||||
ThirdPartyJenkinsViewDetailResponse jenkinsViewDetail = HttpClient.get(urlFormat, headers, ThirdPartyJenkinsViewDetailResponse.class);
|
||||
redisTemplate.opsForValue().set(redisKey, jenkinsViewDetail);
|
||||
return (ThirdPartyJenkinsViewDetailResponse) redisTemplate.opsForValue().get(redisKey);
|
||||
} catch (Exception e) {
|
||||
log.error("Get jenkins projects failed, url:{}", urlFormat, e);
|
||||
return new ThirdPartyJenkinsViewDetailResponse();
|
||||
}
|
||||
}
|
||||
|
||||
public ThirdPartyJenkinsJobDetailResponse jobDetail(String viewName, String jobName) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", Base64AuthUtils.encode("admin", "3%(Lb5GN,M'Yk\\,)Dy\"*"));
|
||||
String urlFormat = String.format(JenkinsConstants.JENKINS_JOB_DETAIL_API, "http://192.168.2.200:9096", viewName, jobName);
|
||||
try {
|
||||
String redisKey = String.format(REDIS_JENKINS_ORIGINAL_VIEW_JOB_DETAIL, viewName, jobName);
|
||||
ThirdPartyJenkinsJobDetailResponse jenkinsJobDetail = HttpClient.get(urlFormat, headers, ThirdPartyJenkinsJobDetailResponse.class);
|
||||
redisTemplate.opsForValue().set(redisKey, jenkinsJobDetail);
|
||||
return (ThirdPartyJenkinsJobDetailResponse) redisTemplate.opsForValue().get(redisKey);
|
||||
} catch (Exception e) {
|
||||
log.error("Get jenkins job detail failed, url:{}", urlFormat, e);
|
||||
return new ThirdPartyJenkinsJobDetailResponse();
|
||||
}
|
||||
}
|
||||
|
||||
public ThirdPartyJenkinsBuildResponse jobBuild(String viewName, String jobName, Long buildNumber) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Authorization", Base64AuthUtils.encode("admin", "3%(Lb5GN,M'Yk\\,)Dy\"*"));
|
||||
String urlFormat = String.format(JenkinsConstants.JENKINS_BUILD_API, "http://192.168.2.200:9096", viewName, jobName, buildNumber);
|
||||
try {
|
||||
String redisKey = String.format(REDIS_JENKINS_ORIGINAL_VIEW_BUILD, viewName, jobName, buildNumber);
|
||||
ThirdPartyJenkinsBuildResponse jenkinsBuild = HttpClient.get(urlFormat, headers, ThirdPartyJenkinsBuildResponse.class);
|
||||
redisTemplate.opsForValue().set(redisKey, jenkinsBuild);
|
||||
return (ThirdPartyJenkinsBuildResponse) redisTemplate.opsForValue().get(redisKey);
|
||||
} catch (Exception e) {
|
||||
log.error("Get jenkins job build failed, url:{}", urlFormat, e);
|
||||
return new ThirdPartyJenkinsBuildResponse();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.aop;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.JenkinsClientApi;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.ThirdPartyJenkinsCrumbResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.consts.JenkinsConstants;
|
||||
import com.qc.soft.deploy.ease.adapter.context.JenkinsCrumbContext;
|
||||
import com.qc.soft.deploy.ease.adapter.convert.JenkinsCrumbConvert;
|
||||
import com.qc.soft.deploy.ease.adapter.enums.BusinessState;
|
||||
import com.qc.soft.framework.basic.exception.BusinessException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.annotation.After;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
//@Aspect
|
||||
//@Component
|
||||
//@Slf4j
|
||||
public class JenkinsClientApiAspect {
|
||||
|
||||
|
||||
@Resource
|
||||
private JenkinsClientApi jenkinsClientApi;
|
||||
|
||||
@Pointcut("execution(* com.qc.soft.deploy.ease.adapter.api.thirdparty.JenkinsClientApi.*(..))")
|
||||
public void pointcut() {
|
||||
}
|
||||
|
||||
|
||||
@Pointcut("execution(* com.qc.soft.deploy.ease.adapter.api.thirdparty.JenkinsClientApi.getJenkinsCrumb(..))")
|
||||
public void excludedMethods() {
|
||||
}
|
||||
|
||||
@Before("pointcut() && !excludedMethods()")
|
||||
public void before() {
|
||||
ThirdPartyJenkinsCrumbResponse response = jenkinsClientApi.getJenkinsCrumb(String.format(JenkinsConstants.JENKINS_CRUMB_IS_SUER_API, "http://192.168.2.200:9096"), "admin", "3%(Lb5GN,M'Yk\\,)Dy\"*");
|
||||
if (response == null) {
|
||||
throw new BusinessException(BusinessState.GET_JENKINS_CRUMB_FAILED);
|
||||
}
|
||||
JenkinsCrumbContext.setJenkinsCrumb(JenkinsCrumbConvert.INSTANCE.response2DTO(response));
|
||||
}
|
||||
|
||||
@After("pointcut()")
|
||||
public void after() {
|
||||
JenkinsCrumbContext.clear();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.request;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
|
||||
public class JenkinsHttpHeaders extends HttpHeaders {
|
||||
|
||||
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class JenkinsCrumbIssuerResponse {
|
||||
|
||||
private String crumb;
|
||||
|
||||
private String cookie;
|
||||
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class JenkinsLastJobDetailChangeSetDetailResponse {
|
||||
|
||||
private String commitId;
|
||||
|
||||
private Date timestamp;
|
||||
|
||||
private Map<String, String> author;
|
||||
|
||||
private String authorEmail;
|
||||
|
||||
private String comment;
|
||||
|
||||
private Date date;
|
||||
|
||||
private String id;
|
||||
|
||||
private String msg;
|
||||
|
||||
private List<Map<String, String>> paths;
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class JenkinsLastJobDetailChangeSetResponse {
|
||||
|
||||
private List<JenkinsLastJobDetailChangeSetDetailResponse> items;
|
||||
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class JenkinsLastJobDetailResponse {
|
||||
|
||||
private String projectName;
|
||||
|
||||
private int number;
|
||||
|
||||
private boolean inProgress;
|
||||
|
||||
private boolean building;
|
||||
|
||||
private String result;
|
||||
|
||||
private Date timestamp;
|
||||
|
||||
private long duration;
|
||||
|
||||
private int queueId;
|
||||
|
||||
private JenkinsLastJobDetailChangeSetResponse changeSet;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class ThirdPartyJenkinsCrumbResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3101286468330530353L;
|
||||
|
||||
private String crumb;
|
||||
|
||||
private String cookie;
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.build;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.qc.soft.deploy.ease.adapter.config.DateStrToFormatDateStrDeserializer;
|
||||
import com.qc.soft.deploy.ease.adapter.config.Timestamp2StrDeserializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsBuildChangeSetDetailResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 179448298612521939L;
|
||||
|
||||
private String commitId;
|
||||
|
||||
@JsonDeserialize(using = Timestamp2StrDeserializer.class)
|
||||
private String timestamp;
|
||||
|
||||
private Map<String, String> author;
|
||||
|
||||
private String authorEmail;
|
||||
|
||||
private String comment;
|
||||
|
||||
@JsonDeserialize(using = DateStrToFormatDateStrDeserializer.class)
|
||||
private String date;
|
||||
|
||||
private String id;
|
||||
|
||||
private String msg;
|
||||
|
||||
private List<Map<String, String>> paths;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.build;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsBuildChangeSetResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1415649691093536940L;
|
||||
|
||||
private List<ThirdPartyJenkinsBuildChangeSetDetailResponse> items;
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.build;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.qc.soft.deploy.ease.adapter.config.Timestamp2StrDeserializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsBuildResponse implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = -2071857721972730643L;
|
||||
|
||||
private String projectName;
|
||||
|
||||
private Integer number;
|
||||
|
||||
private Boolean inProgress;
|
||||
|
||||
private Boolean building;
|
||||
|
||||
private String result;
|
||||
|
||||
@JsonDeserialize(using = Timestamp2StrDeserializer.class)
|
||||
private String timestamp;
|
||||
|
||||
private Long duration;
|
||||
|
||||
private Integer queueId;
|
||||
|
||||
private ThirdPartyJenkinsBuildChangeSetResponse changeSet;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.build;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsBuildSimpleResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1751553747449726589L;
|
||||
|
||||
Integer number;
|
||||
|
||||
String url;
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.build.ThirdPartyJenkinsBuildSimpleResponse;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsJobDetailResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1504176139786054926L;
|
||||
|
||||
String name;
|
||||
|
||||
String color;
|
||||
|
||||
String description;
|
||||
|
||||
String displayName;
|
||||
|
||||
String fullDisplayName;
|
||||
|
||||
String fullName;
|
||||
|
||||
List<ThirdPartyJenkinsBuildSimpleResponse> builds;
|
||||
|
||||
ThirdPartyJenkinsBuildSimpleResponse firstBuild;
|
||||
|
||||
ThirdPartyJenkinsBuildSimpleResponse lastBuild;
|
||||
|
||||
ThirdPartyJenkinsBuildSimpleResponse lastCompletedBuild;
|
||||
|
||||
ThirdPartyJenkinsBuildSimpleResponse lastStableBuild;
|
||||
|
||||
ThirdPartyJenkinsBuildSimpleResponse lastSuccessfulBuild;
|
||||
|
||||
int nextBuildNumber;
|
||||
|
||||
boolean disabled;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsJobHealthReportResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1908278155963533191L;
|
||||
|
||||
String description;
|
||||
|
||||
int score;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsJobResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3928602711303390639L;
|
||||
|
||||
String name;
|
||||
|
||||
String url;
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.view;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3108812282903867631L;
|
||||
|
||||
private List<ThirdPartyJenkinsViewResponse> views;
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.view;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job.ThirdPartyJenkinsJobResponse;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsViewDetailResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4769400085765278323L;
|
||||
|
||||
private String name;
|
||||
|
||||
private List<ThirdPartyJenkinsJobResponse> jobs;
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.qc.soft.deploy.ease.adapter.api.thirdparty.response.view;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
public class ThirdPartyJenkinsViewResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6036234249912113540L;
|
||||
|
||||
String name;
|
||||
|
||||
String url;
|
||||
|
||||
}
|
||||
@ -4,9 +4,15 @@ import com.qc.soft.framework.basic.context.TenantContext;
|
||||
import feign.RequestInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@Configuration
|
||||
public class FeignClientConfig {
|
||||
public class AppConfig {
|
||||
@Bean
|
||||
public RequestInterceptor tenantHeaderInterceptor() {
|
||||
return requestTemplate -> {
|
||||
@ -14,4 +20,5 @@ public class FeignClientConfig {
|
||||
requestTemplate.header("x-tenant-code", TenantContext.getCurrentTenant());
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.qc.soft.deploy.ease.adapter.config;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class DateStrToFormatDateStrDeserializer extends JsonDeserializer<String> {
|
||||
|
||||
private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
private static final SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
|
||||
|
||||
static {
|
||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException {
|
||||
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss Z");
|
||||
OffsetDateTime offsetDateTime = OffsetDateTime.parse(jsonParser.getText(), inputFormatter);
|
||||
LocalDateTime localDateTime = offsetDateTime.toLocalDateTime();
|
||||
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
return localDateTime.format(outputFormatter);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.qc.soft.deploy.ease.adapter.config;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class Timestamp2StrDeserializer extends JsonDeserializer<String> {
|
||||
|
||||
@Override
|
||||
public String deserialize(JsonParser p, DeserializationContext context) throws IOException {
|
||||
long timestamp = p.getLongValue();
|
||||
Instant instant = Instant.ofEpochMilli(timestamp);
|
||||
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
return localDateTime.format(formatter);
|
||||
}
|
||||
}
|
||||
@ -2,27 +2,23 @@ package com.qc.soft.deploy.ease.adapter.consts;
|
||||
|
||||
public class JenkinsConstants {
|
||||
|
||||
|
||||
// viewApi: ${devops.jenkins.basePath}/view/%s/api/json?pretty=true
|
||||
// projectApi: ${devops.jenkins.basePath}/view/%s/job/%s/api/json?pretty=true
|
||||
// projectBuildApi: ${devops.jenkins.basePath}/job/%s/%s/api/json?pretty=true
|
||||
// crumbIssuerApi: ${devops.jenkins.basePath}/crumbIssuer/api/json
|
||||
// buildWithParamsApi: ${devops.jenkins.basePath}/job/%s/buildWithParameters
|
||||
// cleanWorkspaceApi: ${devops.jenkins.basePath}/view/%s/job/%s/doWipeOutWorkspace
|
||||
// buildFailedApi: ${devops.jenkins.basePath}/view/%s/job/%s/%s/consoleText
|
||||
|
||||
public static final String JENKINS_CRUMB_IS_SUER_API = "%s/crumbIssuer/api/json";
|
||||
|
||||
public static final String JENKINS_VIEW_API = "%s/view/%s/api/json?pretty=true";
|
||||
public static final String JENKINS_VIEWS_API = "%s/api/json?pretty=true";
|
||||
|
||||
public static final String JENKINS_PROJECT_VIEW_API = "%s/view/%s/job/%s/api/json?pretty=true";
|
||||
public static final String JENKINS_JOB_ALL_API = "%s/api/json?pretty=true";
|
||||
|
||||
public static final String JENKINS_PROJECT_JOB_DETAIL_API = "%s/job/%s/%s/api/json?pretty=true";
|
||||
public static final String JENKINS_JOB_API = "%s/view/%s/api/json?pretty=true";
|
||||
|
||||
public static final String JENKINS_PROJECT_EXEC_BUILD_API = "%s/job/%s/buildWithParameters";
|
||||
public static final String JENKINS_JOB_DETAIL_API = "%s/view/%s/job/%s/api/json?pretty=true";
|
||||
|
||||
public static final String JENKINS_PROJECT_CLEAN_WORKSPACE_API = "%s/view/%s/job/%s/doWipeOutWorkspace";
|
||||
public static final String JENKINS_BUILD_API = "%s/view/%s/job/%s/%s/api/json?pretty=true";
|
||||
|
||||
public static final String JENKINS_PROJECT_JOB_FAILED_API = "%s/view/%s/job/%s/%s/consoleText";
|
||||
public static final String REDIS_JENKINS_ORIGINAL_VIEW = "deploy-ease:jenkins:original:view";
|
||||
|
||||
public static final String REDIS_JENKINS_ORIGINAL_VIEW_JOB = "deploy-ease:jenkins:original:view:%s";
|
||||
|
||||
public static final String REDIS_JENKINS_ORIGINAL_VIEW_JOB_DETAIL = "deploy-ease:jenkins:original:view:%s:%s";
|
||||
|
||||
public static final String REDIS_JENKINS_ORIGINAL_VIEW_BUILD = "deploy-ease:jenkins:original:view:%s:%s:%s";
|
||||
}
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.qc.soft.deploy.ease.adapter.context;
|
||||
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
public class JenkinsBuildSimpleSupportContext {
|
||||
private static final TransmittableThreadLocal<Pair<String, String>> context = new TransmittableThreadLocal<>();
|
||||
|
||||
public static void setValue(Pair<String, String> value) {
|
||||
context.set(value);
|
||||
}
|
||||
|
||||
public static Pair<String, String> getValue() {
|
||||
return context.get();
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
context.remove();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.qc.soft.deploy.ease.adapter.context;
|
||||
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
import com.qc.soft.deploy.ease.adapter.dto.JenkinsCrumbDTO;
|
||||
|
||||
public class JenkinsCrumbContext {
|
||||
|
||||
private static final TransmittableThreadLocal<JenkinsCrumbDTO> jenkinsCrumb = new TransmittableThreadLocal<>();
|
||||
|
||||
public static void setJenkinsCrumb(JenkinsCrumbDTO jenkinsCrumbDTO) {
|
||||
jenkinsCrumb.set(jenkinsCrumbDTO);
|
||||
}
|
||||
|
||||
public static JenkinsCrumbDTO getJenkinsCrumb() {
|
||||
return jenkinsCrumb.get();
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
jenkinsCrumb.remove();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.qc.soft.deploy.ease.adapter.context;
|
||||
|
||||
public class TenantAdapterContext {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate.JenkinsAggregateResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build.JenkinsBuildResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.job.JenkinsJobDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view.JenkinsResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view.JenkinsViewDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.service.IJenkinsService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mgmt")
|
||||
public class JenkinsController {
|
||||
|
||||
@Resource
|
||||
private IJenkinsService jenkinsService;
|
||||
|
||||
|
||||
@GetMapping(value = "/jenkins/crumb")
|
||||
public void getJenkinsCrumbIssue() {
|
||||
jenkinsService.getJenkinsCrumbIssue(null, null, null);
|
||||
}
|
||||
|
||||
@GetMapping("/jenkins/views")
|
||||
public JenkinsResponse views() {
|
||||
return jenkinsService.views();
|
||||
}
|
||||
|
||||
@GetMapping({"/jenkins/jobs", "/jenkins/jobs/{viewName}"})
|
||||
public JenkinsViewDetailResponse jobs(@PathVariable(value = "viewName", required = false) String viewName) {
|
||||
return jenkinsService.jobs(viewName);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping({"/jenkins/{viewName}/job/{jobName}/detail"})
|
||||
public JenkinsJobDetailResponse jobDetail(
|
||||
@PathVariable(value = "viewName") String viewName,
|
||||
@PathVariable(value = "jobName") String jobName){
|
||||
return jenkinsService.jobDetail(viewName, jobName);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping({"/jenkins/{viewName}/job/{jobName}/build/{buildNumber}"})
|
||||
public JenkinsBuildResponse jobBuild(
|
||||
@PathVariable(value = "viewName") String viewName,
|
||||
@PathVariable(value = "jobName") String jobName,
|
||||
@PathVariable(value = "buildNumber") Long buildNumber){
|
||||
return jenkinsService.jobBuild(viewName, jobName, buildNumber);
|
||||
}
|
||||
|
||||
@GetMapping("jenkins/aggregate")
|
||||
public JenkinsAggregateResponse aggregate(){
|
||||
return jenkinsService.aggregate();
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.internal.IDictionaryServiceApi;
|
||||
import com.qc.soft.deploy.ease.adapter.service.IJenkinsService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Duration;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sse")
|
||||
public class JenkinsSSEController {
|
||||
|
||||
@Resource
|
||||
private IDictionaryServiceApi dictionaryServiceApi;
|
||||
|
||||
@Resource
|
||||
private IJenkinsService jenkinsService;
|
||||
|
||||
// @GetMapping(value = "/jenkins/views", produces = "text/event-stream;charset=UTF-8")
|
||||
// public Flux<Object> jenkinsViews() {
|
||||
// return Flux.interval(Duration.ofSeconds(5)).map(index -> jenkinsService);
|
||||
// }
|
||||
|
||||
|
||||
@GetMapping(value = "/jenkins/crumb")
|
||||
public void getJenkinsCrumbIssue() {
|
||||
jenkinsService.getJenkinsCrumbIssue(null, null, null);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsAggregateResponse {
|
||||
|
||||
private List<JenkinsViewAggregateResponse> views;
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsViewAggregateResponse {
|
||||
|
||||
private String viewName;
|
||||
|
||||
private List<JenkinsViewProjectAggregateResponse> projects;
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsViewProjectAggregateResponse {
|
||||
|
||||
String projectName;
|
||||
|
||||
String color;
|
||||
|
||||
String description;
|
||||
|
||||
String displayName;
|
||||
|
||||
String fullDisplayName;
|
||||
|
||||
String fullName;
|
||||
|
||||
List<JenkinsViewProjectTaskAggregateResponse> builds;
|
||||
|
||||
JenkinsViewProjectTaskAggregateResponse firstBuild;
|
||||
|
||||
JenkinsViewProjectTaskAggregateResponse lastBuild;
|
||||
|
||||
JenkinsViewProjectTaskAggregateResponse lastCompletedBuild;
|
||||
|
||||
JenkinsViewProjectTaskAggregateResponse lastStableBuild;
|
||||
|
||||
JenkinsViewProjectTaskAggregateResponse lastSuccessfulBuild;
|
||||
|
||||
int nextBuildNumber;
|
||||
|
||||
boolean disabled;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build.JenkinsBuildChangeSetResponse;
|
||||
import lombok.Data;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsViewProjectTaskAggregateResponse {
|
||||
|
||||
private Integer number;
|
||||
|
||||
private Boolean inProgress;
|
||||
|
||||
private Boolean building;
|
||||
|
||||
private String result;
|
||||
|
||||
private String timestamp;
|
||||
|
||||
private Long duration;
|
||||
|
||||
private Integer queueId;
|
||||
|
||||
private JenkinsBuildChangeSetResponse changeSet;
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class JenkinsBuildChangeSetDetailResponse {
|
||||
|
||||
private String commitId;
|
||||
|
||||
private String timestamp;
|
||||
|
||||
private Map<String, String> author;
|
||||
|
||||
private String authorEmail;
|
||||
|
||||
private String comment;
|
||||
|
||||
private String date;
|
||||
|
||||
private String id;
|
||||
|
||||
private String msg;
|
||||
|
||||
private List<Map<String, String>> paths;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsBuildChangeSetResponse {
|
||||
|
||||
private List<JenkinsBuildChangeSetDetailResponse> items;
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class JenkinsBuildResponse {
|
||||
|
||||
private String projectName;
|
||||
|
||||
private Integer number;
|
||||
|
||||
private Boolean inProgress;
|
||||
|
||||
private Boolean building;
|
||||
|
||||
private String result;
|
||||
|
||||
private String timestamp;
|
||||
|
||||
private Long duration;
|
||||
|
||||
private Integer queueId;
|
||||
|
||||
private JenkinsBuildChangeSetResponse changeSet;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsBuildSimpleResponse {
|
||||
|
||||
Integer number;
|
||||
|
||||
String url;
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.job;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build.JenkinsBuildSimpleResponse;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsJobDetailResponse {
|
||||
|
||||
String name;
|
||||
|
||||
String color;
|
||||
|
||||
String description;
|
||||
|
||||
String displayName;
|
||||
|
||||
String fullDisplayName;
|
||||
|
||||
String fullName;
|
||||
|
||||
List<JenkinsBuildSimpleResponse> builds;
|
||||
|
||||
JenkinsBuildSimpleResponse firstBuild;
|
||||
|
||||
JenkinsBuildSimpleResponse lastBuild;
|
||||
|
||||
JenkinsBuildSimpleResponse lastCompletedBuild;
|
||||
|
||||
JenkinsBuildSimpleResponse lastStableBuild;
|
||||
|
||||
JenkinsBuildSimpleResponse lastSuccessfulBuild;
|
||||
|
||||
int nextBuildNumber;
|
||||
|
||||
boolean disabled;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.job;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class JenkinsJobResponse {
|
||||
|
||||
String name;
|
||||
|
||||
String url;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsResponse {
|
||||
|
||||
private List<JenkinsViewResponse> views;
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job.ThirdPartyJenkinsJobResponse;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsViewDetailResponse {
|
||||
|
||||
private String name;
|
||||
|
||||
private List<ThirdPartyJenkinsJobResponse> jobs;
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Data
|
||||
public class JenkinsViewResponse {
|
||||
|
||||
String name;
|
||||
|
||||
String url;
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.qc.soft.deploy.ease.adapter.convert;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.build.ThirdPartyJenkinsBuildResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job.ThirdPartyJenkinsJobDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate.JenkinsViewProjectTaskAggregateResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build.JenkinsBuildResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.job.JenkinsJobDetailResponse;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.MappingTarget;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface JenkinsBuildConvert {
|
||||
|
||||
JenkinsBuildConvert INSTANCE = Mappers.getMapper(JenkinsBuildConvert.class);
|
||||
|
||||
JenkinsBuildResponse response2ApiResponse(ThirdPartyJenkinsBuildResponse response);
|
||||
|
||||
void response2ApiAggregateResponse(JenkinsBuildResponse response, @MappingTarget JenkinsViewProjectTaskAggregateResponse target);
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.qc.soft.deploy.ease.adapter.convert;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.view.ThirdPartyJenkinsResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view.JenkinsResponse;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface JenkinsConvert {
|
||||
|
||||
JenkinsConvert INSTANCE = Mappers.getMapper(JenkinsConvert.class);
|
||||
|
||||
JenkinsResponse response2ApiResponse(ThirdPartyJenkinsResponse response);
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.qc.soft.deploy.ease.adapter.convert;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.ThirdPartyJenkinsCrumbResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.dto.JenkinsCrumbDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface JenkinsCrumbConvert {
|
||||
|
||||
JenkinsCrumbConvert INSTANCE = Mappers.getMapper(JenkinsCrumbConvert.class);
|
||||
|
||||
JenkinsCrumbDTO response2DTO(ThirdPartyJenkinsCrumbResponse response);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.qc.soft.deploy.ease.adapter.convert;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job.ThirdPartyJenkinsJobDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.context.JenkinsBuildSimpleSupportContext;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate.JenkinsViewProjectAggregateResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate.JenkinsViewProjectTaskAggregateResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build.JenkinsBuildResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build.JenkinsBuildSimpleResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.job.JenkinsJobDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.service.IJenkinsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.mapstruct.AfterMapping;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.MappingTarget;
|
||||
import org.mapstruct.Mappings;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
@Slf4j
|
||||
public abstract class JenkinsJobDetailConvert {
|
||||
|
||||
@Resource
|
||||
private IJenkinsService jenkinsService;
|
||||
|
||||
public abstract JenkinsJobDetailResponse response2ApiResponse(ThirdPartyJenkinsJobDetailResponse response);
|
||||
|
||||
@Mappings({
|
||||
@Mapping(source = "response.name", target = "projectName")
|
||||
})
|
||||
public abstract JenkinsViewProjectAggregateResponse response2AggregateResponse(JenkinsJobDetailResponse response);
|
||||
|
||||
@AfterMapping
|
||||
void afterMapping(JenkinsBuildSimpleResponse source, @MappingTarget JenkinsViewProjectTaskAggregateResponse target) {
|
||||
Pair<String, String> value = JenkinsBuildSimpleSupportContext.getValue();
|
||||
JenkinsBuildResponse jenkinsBuildResponse = jenkinsService.jobBuild(value.getLeft(), value.getRight(), Long.valueOf(source.getNumber()));
|
||||
JenkinsBuildConvert.INSTANCE.response2ApiAggregateResponse(jenkinsBuildResponse, target);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.qc.soft.deploy.ease.adapter.convert;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.view.ThirdPartyJenkinsViewDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view.JenkinsViewDetailResponse;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface JenkinsViewDetailConvert {
|
||||
|
||||
JenkinsViewDetailConvert INSTANCE = Mappers.getMapper(JenkinsViewDetailConvert.class);
|
||||
|
||||
JenkinsViewDetailResponse response2ApiResponse(ThirdPartyJenkinsViewDetailResponse response);
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package com.qc.soft.deploy.ease.adapter.dto;
|
||||
|
||||
public class JenkinsCrumbDTO {
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
package com.qc.soft.deploy.ease.adapter.enums;
|
||||
|
||||
import com.qc.soft.framework.basic.enums.IBasicState;
|
||||
|
||||
public enum AdapterBusinessErrorCodeI implements IBasicState {
|
||||
}
|
||||
@ -1,9 +1,24 @@
|
||||
package com.qc.soft.deploy.ease.adapter.service;
|
||||
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.ThirdPartyJenkinsCrumbResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate.JenkinsAggregateResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build.JenkinsBuildResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.job.JenkinsJobDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view.JenkinsResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view.JenkinsViewDetailResponse;
|
||||
|
||||
public interface IJenkinsService {
|
||||
|
||||
|
||||
public void getJenkinsCrumbIssue(String url, String username, String password);
|
||||
ThirdPartyJenkinsCrumbResponse getJenkinsCrumbIssue(String url, String username, String password);
|
||||
|
||||
JenkinsResponse views();
|
||||
|
||||
JenkinsViewDetailResponse jobs(String viewName);
|
||||
|
||||
JenkinsJobDetailResponse jobDetail(String viewName, String jobName);
|
||||
|
||||
JenkinsBuildResponse jobBuild(String viewName, String jobName, Long buildNumber);
|
||||
|
||||
JenkinsAggregateResponse aggregate();
|
||||
}
|
||||
|
||||
@ -1,12 +1,36 @@
|
||||
package com.qc.soft.deploy.ease.adapter.service.impl;
|
||||
|
||||
import cn.hutool.core.date.StopWatch;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.JenkinsClientApi;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.JenkinsCrumbIssuerResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.ThirdPartyJenkinsCrumbResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.build.ThirdPartyJenkinsBuildResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.job.ThirdPartyJenkinsJobDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.api.thirdparty.response.view.ThirdPartyJenkinsResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.consts.JenkinsConstants;
|
||||
import com.qc.soft.deploy.ease.adapter.context.JenkinsBuildSimpleSupportContext;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate.JenkinsAggregateResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate.JenkinsViewAggregateResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.aggregate.JenkinsViewProjectAggregateResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.build.JenkinsBuildResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.job.JenkinsJobDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view.JenkinsResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.controller.response.jenkins.view.JenkinsViewDetailResponse;
|
||||
import com.qc.soft.deploy.ease.adapter.convert.JenkinsBuildConvert;
|
||||
import com.qc.soft.deploy.ease.adapter.convert.JenkinsConvert;
|
||||
import com.qc.soft.deploy.ease.adapter.convert.JenkinsJobDetailConvert;
|
||||
import com.qc.soft.deploy.ease.adapter.convert.JenkinsViewDetailConvert;
|
||||
import com.qc.soft.deploy.ease.adapter.service.IJenkinsService;
|
||||
import com.qc.soft.framework.basic.context.SpringContext;
|
||||
import lombok.val;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class JenkinsServiceImpl implements IJenkinsService {
|
||||
@ -14,9 +38,66 @@ public class JenkinsServiceImpl implements IJenkinsService {
|
||||
@Resource
|
||||
private JenkinsClientApi jenkinsClientApi;
|
||||
|
||||
@Resource
|
||||
private JenkinsJobDetailConvert jenkinsJobDetailConvert;
|
||||
|
||||
|
||||
@Resource
|
||||
private SpringContext springContext;
|
||||
|
||||
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
@Override
|
||||
public void getJenkinsCrumbIssue(String url, String username, String password) {
|
||||
JenkinsCrumbIssuerResponse admin = jenkinsClientApi.getJenkinsCrumbIssue(String.format(JenkinsConstants.JENKINS_CRUMB_IS_SUER_API, "http://192.168.2.200:9096"), "admin", "3%(Lb5GN,M'Yk\\,)Dy\"*");
|
||||
System.out.println(admin);
|
||||
public ThirdPartyJenkinsCrumbResponse getJenkinsCrumbIssue(String url, String username, String password) {
|
||||
return jenkinsClientApi.getJenkinsCrumb(String.format(JenkinsConstants.JENKINS_CRUMB_IS_SUER_API, "http://192.168.2.200:9096"), "admin", "3%(Lb5GN,M'Yk\\,)Dy\"*");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JenkinsResponse views() {
|
||||
return JenkinsConvert.INSTANCE.response2ApiResponse(jenkinsClientApi.getViews());
|
||||
}
|
||||
|
||||
@Override
|
||||
public JenkinsViewDetailResponse jobs(String viewName) {
|
||||
return JenkinsViewDetailConvert.INSTANCE.response2ApiResponse(jenkinsClientApi.jobs(viewName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public JenkinsJobDetailResponse jobDetail(String viewName, String jobName) {
|
||||
return jenkinsJobDetailConvert.response2ApiResponse(jenkinsClientApi.jobDetail(viewName, jobName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public JenkinsBuildResponse jobBuild(String viewName, String jobName, Long buildNumber) {
|
||||
return JenkinsBuildConvert.INSTANCE.response2ApiResponse(jenkinsClientApi.jobBuild(viewName, jobName, buildNumber));
|
||||
}
|
||||
|
||||
@Override
|
||||
public JenkinsAggregateResponse aggregate() {
|
||||
val aggregate = new JenkinsAggregateResponse();
|
||||
List<JenkinsViewAggregateResponse> viewsAggregate = new ArrayList<>();
|
||||
JenkinsResponse container = views();
|
||||
container.getViews().stream().filter(view -> !view.getName().equals("all")).forEach(view -> {
|
||||
String viewName = view.getName();
|
||||
JenkinsViewDetailResponse jobsContainer = jobs(viewName);
|
||||
List<JenkinsViewProjectAggregateResponse> viewProjectsAggregate = new ArrayList<>();
|
||||
jobsContainer.getJobs().forEach(job -> {
|
||||
JenkinsJobDetailResponse jobDetailContainer = jobDetail(viewName, job.getName());
|
||||
JenkinsBuildSimpleSupportContext.setValue(Pair.of(viewName, job.getName()));
|
||||
JenkinsViewProjectAggregateResponse viewProjectAggregate = jenkinsJobDetailConvert.response2AggregateResponse(jobDetailContainer);
|
||||
JenkinsBuildSimpleSupportContext.clear();
|
||||
viewProjectsAggregate.add(viewProjectAggregate);
|
||||
});
|
||||
JenkinsViewAggregateResponse viewAggregate = new JenkinsViewAggregateResponse();
|
||||
viewAggregate.setViewName(viewName);
|
||||
viewAggregate.setProjects(viewProjectsAggregate);
|
||||
viewsAggregate.add(viewAggregate);
|
||||
});
|
||||
aggregate.setViews(viewsAggregate);
|
||||
return aggregate;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,2 +1,6 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.qc.soft.framework.basic.config.GlobalWebConfigurer
|
||||
com.qc.soft.framework.basic.context.SpringContext,\
|
||||
com.qc.soft.framework.basic.redis.RedisAutoConfiguration,\
|
||||
com.qc.soft.framework.basic.http.HttpAutoConfiguration,\
|
||||
com.qc.soft.framework.basic.config.GlobalResponseHandler,\
|
||||
com.qc.soft.framework.basic.config.GlobalExceptionHandler
|
||||
@ -0,0 +1,15 @@
|
||||
spring:
|
||||
application:
|
||||
name: deploy-ease-tenant-adapter
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
database: 0
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
max-wait: 1ms
|
||||
server:
|
||||
port: 8080
|
||||
@ -11,17 +11,17 @@ spring:
|
||||
config:
|
||||
group: ${DEPLOY_ENV}
|
||||
namespace: ${DEPLOY_ENV}
|
||||
# shared-configs[0]:
|
||||
# group: common
|
||||
# data-id: common.yml
|
||||
# refresh: true
|
||||
extension-configs[0]:
|
||||
group: common
|
||||
data-id: common.yml
|
||||
refresh: false
|
||||
refresh: true
|
||||
extension-configs[1]:
|
||||
group: business
|
||||
data-id: deploy-ease-tenant-adapter.yml
|
||||
refresh: false
|
||||
config:
|
||||
override-none: false
|
||||
allow-override: true
|
||||
override-system-properties: false
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
@ -1,2 +1,6 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.qc.soft.framework.basic.config.GlobalWebConfigurer
|
||||
com.qc.soft.framework.basic.context.SpringContext,\
|
||||
com.qc.soft.framework.basic.redis.RedisAutoConfiguration,\
|
||||
com.qc.soft.framework.basic.http.HttpAutoConfiguration,\
|
||||
com.qc.soft.framework.basic.config.GlobalResponseHandler,\
|
||||
com.qc.soft.framework.basic.config.GlobalExceptionHandler
|
||||
@ -11,17 +11,17 @@ spring:
|
||||
config:
|
||||
group: ${DEPLOY_ENV}
|
||||
namespace: ${DEPLOY_ENV}
|
||||
# shared-configs[0]:
|
||||
# group: common
|
||||
# data-id: common.yml
|
||||
# refresh: true
|
||||
extension-configs[0]:
|
||||
group: common
|
||||
data-id: common.yml
|
||||
refresh: false
|
||||
refresh: true
|
||||
extension-configs[1]:
|
||||
group: business
|
||||
data-id: deploy-ease-tenant-adapter.yml
|
||||
refresh: false
|
||||
config:
|
||||
override-none: false
|
||||
allow-override: true
|
||||
override-system-properties: false
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
artifactId=deploy-ease-tenant-adapter
|
||||
groupId=com.qc.soft
|
||||
version=1.0.0
|
||||
@ -1,19 +0,0 @@
|
||||
com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsCrumbIssuerResponse.class
|
||||
com\qc\soft\deploy\ease\adapter\enums\AdapterBusinessErrorCodeI.class
|
||||
com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsLastJobDetailChangeSetResponse.class
|
||||
com\qc\soft\deploy\ease\adapter\api\thirdparty\JenkinsClientApi.class
|
||||
com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsApiInfoDto.class
|
||||
com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsLastJobDetailChangeSetDetailResponse.class
|
||||
com\qc\soft\deploy\ease\adapter\config\TenantProcessor.class
|
||||
com\qc\soft\deploy\ease\adapter\consts\JenkinsConstants.class
|
||||
com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsLastJobDetailResponse.class
|
||||
com\qc\soft\deploy\ease\adapter\controller\JenkinsSSEController.class
|
||||
com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsApiInfoDto$JenkinsApiInfoDtoBuilder.class
|
||||
com\qc\soft\deploy\ease\adapter\config\FeignClientConfig.class
|
||||
com\qc\soft\deploy\ease\adapter\enums\BusinessState.class
|
||||
com\qc\soft\deploy\ease\adapter\consts\Consts.class
|
||||
com\qc\soft\deploy\ease\adapter\api\internal\IDictionaryServiceApi.class
|
||||
com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JobInfoDto.class
|
||||
com\qc\soft\deploy\ease\adapter\DeployEaseTenantAdapterApplication.class
|
||||
com\qc\soft\deploy\ease\adapter\service\IJenkinsService.class
|
||||
com\qc\soft\deploy\ease\adapter\service\impl\JenkinsServiceImpl.class
|
||||
@ -1,18 +0,0 @@
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\api\internal\IDictionaryServiceApi.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsApiInfoDto.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\api\thirdparty\JenkinsClientApi.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\DeployEaseTenantAdapterApplication.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\consts\JenkinsConstants.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsLastJobDetailResponse.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\controller\JenkinsSSEController.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\enums\BusinessState.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsLastJobDetailChangeSetResponse.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\config\TenantProcessor.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\consts\Consts.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsLastJobDetailChangeSetDetailResponse.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JobInfoDto.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\config\FeignClientConfig.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\enums\AdapterBusinessErrorCodeI.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\api\thirdparty\response\JenkinsCrumbIssuerResponse.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\service\IJenkinsService.java
|
||||
D:\work\github-workspace\deploy-ease-backend\deploy-ease-tenant-adapter\src\main\java\com\qc\soft\deploy\ease\adapter\service\impl\JenkinsServiceImpl.java
|
||||
6
pom.xml
6
pom.xml
@ -33,9 +33,15 @@
|
||||
<nacos-cloud.version>2.2.9.RELEASE</nacos-cloud.version>
|
||||
<flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
|
||||
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
|
||||
<commons-pool2.version>2.6.2</commons-pool2.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
<version>${commons-pool2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user