diff --git a/.springjavaformatconfig b/.springjavaformatconfig index 12643781..db822775 100644 --- a/.springjavaformatconfig +++ b/.springjavaformatconfig @@ -1 +1 @@ -java-baseline=8 \ No newline at end of file +java-baseline=17 \ No newline at end of file diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/AuthorizationServerConfiguration.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/AuthorizationServerConfiguration.java index a6e9105d..81dfbdf0 100755 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/AuthorizationServerConfiguration.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/AuthorizationServerConfiguration.java @@ -74,12 +74,13 @@ public class AuthorizationServerConfiguration { .authorizationEndpoint(authorizationEndpoint -> authorizationEndpoint// 授权码端点个性化confirm页面 .consentPage(SecurityConstants.CUSTOM_CONSENT_PAGE_URI))); - RequestMatcher endpointsMatcher = authorizationServerConfigurer.getEndpointsMatcher(); - DefaultSecurityFilterChain securityFilterChain = http.requestMatcher(endpointsMatcher) - .authorizeRequests(authorizeRequests -> authorizeRequests.anyRequest().authenticated()) - .apply(authorizationServerConfigurer.authorizationService(authorizationService)// redis存储token的实现 - .authorizationServerSettings(AuthorizationServerSettings.builder() - .issuer(SecurityConstants.PROJECT_LICENSE).build())) + DefaultSecurityFilterChain securityFilterChain = http.authorizeHttpRequests(authorizeRequests -> { + // 自定义接口、端点暴露 + authorizeRequests.requestMatchers("/token/**", "/actuator/**", "/css/**", "/error").permitAll(); + authorizeRequests.anyRequest().authenticated(); + }).apply(authorizationServerConfigurer.authorizationService(authorizationService)// redis存储token的实现 + .authorizationServerSettings( + AuthorizationServerSettings.builder().issuer(SecurityConstants.PROJECT_LICENSE).build())) // 授权码登录的登录页个性化 .and().apply(new FormIdentityLoginConfigurer()).and().build(); diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfiguration.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfiguration.java index 0ebc699d..c8ded5f8 100755 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfiguration.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfiguration.java @@ -41,7 +41,7 @@ public class WebSecurityConfiguration { */ @Bean SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { - http.authorizeRequests(authorizeRequests -> authorizeRequests.antMatchers("/token/*").permitAll()// 开放自定义的部分端点 + http.authorizeHttpRequests(authorizeRequests -> authorizeRequests.requestMatchers("/token/*").permitAll()// 开放自定义的部分端点 .anyRequest().authenticated()).headers().frameOptions().sameOrigin()// 避免iframe同源无法登录 .and().apply(new FormIdentityLoginConfigurer()); // 表单登录个性化 // 处理 UsernamePasswordAuthenticationToken @@ -60,7 +60,7 @@ public class WebSecurityConfiguration { @Bean @Order(0) SecurityFilterChain resources(HttpSecurity http) throws Exception { - http.requestMatchers((matchers) -> matchers.antMatchers("/actuator/**", "/css/**", "/error")) + http.securityMatchers((matchers) -> matchers.requestMatchers("/actuator/**", "/css/**", "/error")) .authorizeHttpRequests((authorize) -> authorize.anyRequest().permitAll()).requestCache().disable() .securityContext().disable().sessionManagement().disable(); return http.build(); diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java index f551f77b..23ca251d 100644 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/support/base/OAuth2ResourceOwnerBaseAuthenticationProvider.java @@ -216,6 +216,7 @@ public abstract class OAuth2ResourceOwnerBaseAuthenticationProvider) () -> new InternalAuthenticationServiceException("web request is empty")); - Map paramMap = ServletUtil.getParamMap(request); - String grantType = paramMap.get(OAuth2ParameterNames.GRANT_TYPE); - String clientId = paramMap.get(OAuth2ParameterNames.CLIENT_ID); + String grantType = WebUtils.getRequest().get().getParameter(OAuth2ParameterNames.GRANT_TYPE); + String clientId = WebUtils.getRequest().get().getParameter(OAuth2ParameterNames.CLIENT_ID); if (StrUtil.isBlank(clientId)) { clientId = basicConvert.convert(request).getName(); diff --git a/pig-auth/src/main/resources/application.yml b/pig-auth/src/main/resources/application.yml index 3690b33d..7ce69790 100755 --- a/pig-auth/src/main/resources/application.yml +++ b/pig-auth/src/main/resources/application.yml @@ -15,3 +15,5 @@ spring: - nacos:application-@profiles.active@.yml - nacos:${spring.application.name}-@profiles.active@.yml + + diff --git a/pig-common/pig-common-bom/pom.xml b/pig-common/pig-common-bom/pom.xml index be53ae16..d0a9aa85 100644 --- a/pig-common/pig-common-bom/pom.xml +++ b/pig-common/pig-common-bom/pom.xml @@ -15,7 +15,7 @@ ${project.version} - 2.7.6 + 3.0.0 UTF-8 2.17.1 1.8 @@ -23,15 +23,15 @@ 4.9.9 0.0.34 1.2.83 - 1.6.9 - 2.2.0 - 3.5.2 + 2.0.0 + 2.2.7 + 3.5.2.7-SNAPSHOT 8.0.31 - 1.5.2 + 1.6.1 3.0.0 7.1 3.0.0 - 2.0.2 + 3.0.0 2.3.5 5.8.10 2.7.4 @@ -104,24 +104,19 @@ org.springdoc - springdoc-openapi-webmvc-core + springdoc-openapi-starter-webflux-ui + ${springdoc.version} + + + org.springdoc + springdoc-openapi-starter-webmvc-api ${springdoc.version} io.swagger.core.v3 - swagger-annotations + swagger-annotations-jakarta ${swagger.core.version} - - org.springdoc - springdoc-openapi-webflux-ui - ${springdoc.version} - - - org.springdoc - springdoc-openapi-security - ${springdoc.version} - com.alibaba diff --git a/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/sentinel/ext/PigSentinelFeign.java b/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/sentinel/ext/PigSentinelFeign.java index 474ff717..ea1d9d80 100644 --- a/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/sentinel/ext/PigSentinelFeign.java +++ b/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/sentinel/ext/PigSentinelFeign.java @@ -24,7 +24,7 @@ import feign.Target; import org.springframework.beans.BeansException; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.cloud.openfeign.FeignContext; +import org.springframework.cloud.openfeign.FeignClientFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.core.annotation.AnnotationUtils; @@ -58,7 +58,7 @@ public final class PigSentinelFeign { private ApplicationContext applicationContext; - private FeignContext feignContext; + private FeignClientFactory feignClientFactory; @Override public Feign.Builder invocationHandlerFactory(InvocationHandlerFactory invocationHandlerFactory) { @@ -104,7 +104,7 @@ public final class PigSentinelFeign { } private Object getFromContext(String name, String type, Class fallbackType, Class targetType) { - Object fallbackInstance = feignContext.getInstance(name, fallbackType); + Object fallbackInstance = feignClientFactory.getInstance(name, fallbackType); if (fallbackInstance == null) { throw new IllegalStateException(String.format( "No %s instance of type %s found for feign client %s", type, fallbackType, name)); @@ -138,7 +138,7 @@ public final class PigSentinelFeign { @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { this.applicationContext = applicationContext; - feignContext = this.applicationContext.getBean(FeignContext.class); + this.feignClientFactory = (FeignClientFactory)this.applicationContext.getBean(FeignClientFactory.class); } } diff --git a/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/util/SysLogUtils.java b/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/util/SysLogUtils.java index fd3e4a80..f6132496 100755 --- a/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/util/SysLogUtils.java +++ b/pig-common/pig-common-log/src/main/java/com/pig4cloud/pig/common/log/util/SysLogUtils.java @@ -17,9 +17,9 @@ package com.pig4cloud.pig.common.log.util; import cn.hutool.core.util.URLUtil; -import cn.hutool.extra.servlet.ServletUtil; import cn.hutool.http.HttpUtil; import com.pig4cloud.pig.admin.api.entity.SysLog; +import jakarta.servlet.http.HttpServletRequest; import lombok.experimental.UtilityClass; import org.springframework.core.LocalVariableTableParameterNameDiscoverer; import org.springframework.expression.EvaluationContext; @@ -32,7 +32,6 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; -import jakarta.servlet.http.HttpServletRequest; import java.lang.reflect.Method; import java.util.Objects; @@ -49,7 +48,6 @@ public class SysLogUtils { .requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); SysLog sysLog = new SysLog(); sysLog.setType(LogTypeEnum.NORMAL.getType()); - sysLog.setRemoteAddr(ServletUtil.getClientIP(request)); sysLog.setRequestUri(URLUtil.getPath(request.getRequestURI())); sysLog.setMethod(request.getMethod()); sysLog.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); diff --git a/pig-common/pig-common-mybatis/pom.xml b/pig-common/pig-common-mybatis/pom.xml index d233e3f5..37b92c86 100755 --- a/pig-common/pig-common-mybatis/pom.xml +++ b/pig-common/pig-common-mybatis/pom.xml @@ -45,10 +45,10 @@ com.baomidou mybatis-plus-extension - + io.swagger.core.v3 - swagger-annotations + swagger-annotations-jakarta diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/annotation/EnablePigResourceServer.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/annotation/EnablePigResourceServer.java index 806cbea8..6bc57c93 100644 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/annotation/EnablePigResourceServer.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/annotation/EnablePigResourceServer.java @@ -20,7 +20,7 @@ import com.pig4cloud.pig.common.security.component.PigResourceServerAutoConfigur import com.pig4cloud.pig.common.security.component.PigResourceServerConfiguration; import com.pig4cloud.pig.common.security.feign.PigFeignClientConfiguration; import org.springframework.context.annotation.Import; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import java.lang.annotation.*; @@ -32,9 +32,9 @@ import java.lang.annotation.*; */ @Documented @Inherited +@EnableMethodSecurity @Target({ ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) -@EnableGlobalMethodSecurity(prePostEnabled = true) @Import({ PigResourceServerAutoConfiguration.class, PigResourceServerConfiguration.class, PigFeignClientConfiguration.class }) public @interface EnablePigResourceServer { diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigResourceServerConfiguration.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigResourceServerConfiguration.java index 4e5a2c29..858168ee 100644 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigResourceServerConfiguration.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigResourceServerConfiguration.java @@ -50,8 +50,8 @@ public class PigResourceServerConfiguration { @Order(Ordered.HIGHEST_PRECEDENCE) SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { - http.authorizeRequests(authorizeRequests -> authorizeRequests - .antMatchers(ArrayUtil.toArray(permitAllUrl.getUrls(), String.class)).permitAll().anyRequest() + http.authorizeHttpRequests(authorizeRequests -> authorizeRequests + .requestMatchers(ArrayUtil.toArray(permitAllUrl.getUrls(), String.class)).permitAll().anyRequest() .authenticated()) .oauth2ResourceServer( oauth2 -> oauth2.opaqueToken(token -> token.introspector(customOpaqueTokenIntrospector)) diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigRemoteRegisteredClientRepository.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigRemoteRegisteredClientRepository.java index ee44bae1..41047136 100644 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigRemoteRegisteredClientRepository.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigRemoteRegisteredClientRepository.java @@ -84,7 +84,7 @@ public class PigRemoteRegisteredClientRepository implements RegisteredClientRepo */ @Override @SneakyThrows - @Cacheable(value = CacheConstants.CLIENT_DETAILS_KEY, key = "#clientId", unless = "#result == null") +// @Cacheable(value = CacheConstants.CLIENT_DETAILS_KEY, key = "#clientId", unless = "#result == null") public RegisteredClient findByClientId(String clientId) { SysOauthClientDetails clientDetails = RetOps.of(clientDetailsService.getClientDetailsById(clientId)).getData() diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java index 0eb0b862..5e42728c 100755 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java @@ -50,16 +50,16 @@ public class PigUserDetailsServiceImpl implements PigUserDetailsService { @Override @SneakyThrows public UserDetails loadUserByUsername(String username) { - Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS); - if (cache != null && cache.get(username) != null) { - return (PigUser) cache.get(username).get(); - } +// Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS); +// if (cache != null && cache.get(username) != null) { +// return (PigUser) cache.get(username).get(); +// } R result = remoteUserService.info(username); UserDetails userDetails = getUserDetails(result); - if (cache != null) { - cache.put(username, userDetails); - } +// if (cache != null) { +// cache.put(username, userDetails); +// } return userDetails; } diff --git a/pig-common/pig-common-swagger/pom.xml b/pig-common/pig-common-swagger/pom.xml index 854dad19..e9eacb17 100644 --- a/pig-common/pig-common-swagger/pom.xml +++ b/pig-common/pig-common-swagger/pom.xml @@ -37,15 +37,7 @@ org.springdoc - springdoc-openapi-webmvc-core - - - org.springdoc - springdoc-openapi-security - - - io.swagger.core.v3 - swagger-annotations + springdoc-openapi-starter-webmvc-api diff --git a/pig-gateway/pom.xml b/pig-gateway/pom.xml index 7f625d7a..cbace3d8 100755 --- a/pig-gateway/pom.xml +++ b/pig-gateway/pom.xml @@ -49,25 +49,25 @@ com.alibaba.cloud spring-cloud-starter-alibaba-nacos-config - - - com.alibaba.cloud - spring-cloud-alibaba-sentinel-gateway - - - com.alibaba.cloud - spring-cloud-starter-alibaba-sentinel - + + + + + + + + + org.springframework.cloud spring-cloud-starter-loadbalancer - - com.github.ben-manes.caffeine - caffeine - + + + + com.pig4cloud.plugin @@ -90,7 +90,7 @@ org.springdoc - springdoc-openapi-webflux-ui + springdoc-openapi-starter-webflux-ui diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/GatewayConfiguration.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/GatewayConfiguration.java index ab52ce94..ceaaeed7 100644 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/GatewayConfiguration.java +++ b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/GatewayConfiguration.java @@ -3,11 +3,9 @@ package com.pig4cloud.pig.gateway.config; import com.fasterxml.jackson.databind.ObjectMapper; import com.pig4cloud.pig.gateway.filter.PasswordDecoderFilter; import com.pig4cloud.pig.gateway.filter.PigRequestGlobalFilter; -import com.pig4cloud.pig.gateway.filter.SwaggerBasicGatewayFilter; import com.pig4cloud.pig.gateway.filter.ValidateCodeGatewayFilter; import com.pig4cloud.pig.gateway.handler.GlobalExceptionHandler; import com.pig4cloud.pig.gateway.handler.ImageCodeHandler; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -32,13 +30,6 @@ public class GatewayConfiguration { return new PigRequestGlobalFilter(); } - @Bean - @ConditionalOnProperty(name = "swagger.basic.enabled") - public SwaggerBasicGatewayFilter swaggerBasicGatewayFilter( - SpringDocConfiguration.SwaggerDocProperties swaggerProperties) { - return new SwaggerBasicGatewayFilter(swaggerProperties); - } - @Bean public ValidateCodeGatewayFilter validateCodeGatewayFilter(GatewayConfigProperties configProperties, ObjectMapper objectMapper, RedisTemplate redisTemplate) { diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/SpringDocConfiguration.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/SpringDocConfiguration.java deleted file mode 100644 index 9b24743b..00000000 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/config/SpringDocConfiguration.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.pig4cloud.pig.gateway.config; - -import lombok.Data; -import org.springdoc.core.GroupedOpenApi; -import org.springdoc.core.SwaggerUiConfigParameters; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * @author lengleng - * @date 2022/3/26 - *

- * swagger 3.0 展示 - */ -@Configuration(proxyBeanMethods = false) -public class SpringDocConfiguration { - - @Bean - @Lazy(false) - @ConditionalOnProperty(name = "springdoc.api-docs.enabled", matchIfMissing = true) - public List apis(SwaggerUiConfigParameters swaggerUiConfigParameters, - SwaggerDocProperties swaggerProperties) { - List groups = new ArrayList<>(); - for (String value : swaggerProperties.getServices().values()) { - swaggerUiConfigParameters.addGroup(value); - } - return groups; - } - - @Data - @Component - @ConfigurationProperties("swagger") - public class SwaggerDocProperties { - - private Map services; - - /** - * 认证参数 - */ - private SwaggerBasic basic = new SwaggerBasic(); - - @Data - public class SwaggerBasic { - - /** - * 是否开启 basic 认证 - */ - private Boolean enabled; - - /** - * 用户名 - */ - private String username; - - /** - * 密码 - */ - private String password; - - } - - } - -} diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/PasswordDecoderFilter.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/PasswordDecoderFilter.java index 5435889d..c5b916bd 100755 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/PasswordDecoderFilter.java +++ b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/PasswordDecoderFilter.java @@ -44,8 +44,8 @@ import org.springframework.web.server.ServerWebExchange; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import jakarta.crypto.spec.IvParameterSpec; -import jakarta.crypto.spec.SecretKeySpec; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; import java.nio.charset.Charset; import java.util.List; import java.util.Map; diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/PigRequestGlobalFilter.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/PigRequestGlobalFilter.java index 16b3f658..238a4314 100755 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/PigRequestGlobalFilter.java +++ b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/PigRequestGlobalFilter.java @@ -18,9 +18,11 @@ package com.pig4cloud.pig.gateway.filter; import com.pig4cloud.pig.common.core.constant.CommonConstants; import com.pig4cloud.pig.common.core.constant.SecurityConstants; +import com.pig4cloud.pig.common.core.util.SpringContextHolder; import org.springframework.cloud.gateway.filter.GatewayFilterChain; import org.springframework.cloud.gateway.filter.GlobalFilter; import org.springframework.core.Ordered; +import org.springframework.core.env.Environment; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.util.StringUtils; import org.springframework.web.server.ServerWebExchange; @@ -54,6 +56,9 @@ public class PigRequestGlobalFilter implements GlobalFilter, Ordered { */ @Override public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { + + Environment environment = SpringContextHolder.getApplicationContext().getEnvironment(); + // 1. 清洗请求头中from 参数 ServerHttpRequest request = exchange.getRequest().mutate().headers(httpHeaders -> { httpHeaders.remove(SecurityConstants.FROM); diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/SwaggerBasicGatewayFilter.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/SwaggerBasicGatewayFilter.java deleted file mode 100644 index e52e4c87..00000000 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/filter/SwaggerBasicGatewayFilter.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.pig4cloud.pig.gateway.filter; - -import com.pig4cloud.pig.gateway.config.SpringDocConfiguration; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.cloud.gateway.filter.GatewayFilterChain; -import org.springframework.cloud.gateway.filter.GlobalFilter; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.server.reactive.ServerHttpRequest; -import org.springframework.http.server.reactive.ServerHttpResponse; -import org.springframework.util.Base64Utils; -import org.springframework.util.StringUtils; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Mono; - -import java.nio.charset.StandardCharsets; - -/** - * swagger 开启basic 认证 - * - * @author edgar - * @date 2022/5/8 - */ -@Slf4j -@RequiredArgsConstructor -public class SwaggerBasicGatewayFilter implements GlobalFilter { - - private static final String API_URI = "/v3/api-docs"; - - private static final String BASIC_PREFIX = "Basic "; - - private final SpringDocConfiguration.SwaggerDocProperties swaggerProperties; - - @Override - public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { - ServerHttpRequest request = exchange.getRequest(); - - if (!request.getURI().getPath().contains(API_URI)) { - return chain.filter(exchange); - } - - if (hasAuth(exchange)) { - return chain.filter(exchange); - } - else { - ServerHttpResponse response = exchange.getResponse(); - response.setStatusCode(HttpStatus.UNAUTHORIZED); - response.getHeaders().add(HttpHeaders.WWW_AUTHENTICATE, "Basic Realm=\"pig\""); - return response.setComplete(); - } - } - - /** - * 简单的basic认证 - * @param exchange 上下文 - * @return 是否有权限 - */ - private boolean hasAuth(ServerWebExchange exchange) { - ServerHttpRequest request = exchange.getRequest(); - String auth = request.getHeaders().getFirst(HttpHeaders.AUTHORIZATION); - log.info("Basic认证信息为:{}", auth); - if (!StringUtils.hasText(auth) || !auth.startsWith(BASIC_PREFIX)) { - return Boolean.FALSE; - } - - String username = swaggerProperties.getBasic().getUsername(); - String password = swaggerProperties.getBasic().getPassword(); - - String encodeToString = Base64Utils - .encodeToString((username + ":" + password).getBytes(StandardCharsets.UTF_8)); - - return auth.equals(BASIC_PREFIX + encodeToString); - } - -} diff --git a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/handler/GlobalExceptionHandler.java b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/handler/GlobalExceptionHandler.java index ee9f98fd..967ee46e 100644 --- a/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/handler/GlobalExceptionHandler.java +++ b/pig-gateway/src/main/java/com/pig4cloud/pig/gateway/handler/GlobalExceptionHandler.java @@ -55,7 +55,7 @@ public class GlobalExceptionHandler implements ErrorWebExceptionHandler { // header set response.getHeaders().setContentType(MediaType.APPLICATION_JSON); if (ex instanceof ResponseStatusException) { - response.setStatusCode(((ResponseStatusException) ex).getStatus()); + response.setStatusCode(((ResponseStatusException) ex).getStatusCode()); } return response.writeWith(Mono.fromSupplier(() -> { diff --git a/pig-upms/pig-upms-api/pom.xml b/pig-upms/pig-upms-api/pom.xml index 03c66e10..9b5641da 100755 --- a/pig-upms/pig-upms-api/pom.xml +++ b/pig-upms/pig-upms-api/pom.xml @@ -36,11 +36,6 @@ com.pig4cloud pig-common-core - - - io.swagger.core.v3 - swagger-annotations - org.springframework.cloud diff --git a/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/service/impl/GenDatasourceConfServiceImpl.java b/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/service/impl/GenDatasourceConfServiceImpl.java index 3c23ae5e..7f3d5d2e 100755 --- a/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/service/impl/GenDatasourceConfServiceImpl.java +++ b/pig-visual/pig-codegen/src/main/java/com/pig4cloud/pig/codegen/service/impl/GenDatasourceConfServiceImpl.java @@ -29,7 +29,7 @@ import lombok.extern.slf4j.Slf4j; import org.jasypt.encryption.StringEncryptor; import org.springframework.stereotype.Service; -import jakarta.sql.DataSource; +import javax.sql.DataSource; import java.sql.DriverManager; import java.sql.SQLException; diff --git a/pig-visual/pig-monitor/src/main/java/com/pig4cloud/pig/monitor/config/WebSecurityConfigurer.java b/pig-visual/pig-monitor/src/main/java/com/pig4cloud/pig/monitor/config/WebSecurityConfigurer.java index 316f9a78..3685a239 100755 --- a/pig-visual/pig-monitor/src/main/java/com/pig4cloud/pig/monitor/config/WebSecurityConfigurer.java +++ b/pig-visual/pig-monitor/src/main/java/com/pig4cloud/pig/monitor/config/WebSecurityConfigurer.java @@ -49,8 +49,8 @@ public class WebSecurityConfigurer { SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); successHandler.setTargetUrlParameter("redirectTo"); successHandler.setDefaultTargetUrl(adminContextPath + "/"); - http.headers().frameOptions().disable().and().authorizeRequests() - .antMatchers(adminContextPath + "/assets/**", adminContextPath + "/login", + http.headers().frameOptions().disable().and().authorizeHttpRequests() + .requestMatchers(adminContextPath + "/assets/**", adminContextPath + "/login", adminContextPath + "/instances/**", adminContextPath + "/actuator/**") .permitAll().anyRequest().authenticated().and().formLogin().loginPage(adminContextPath + "/login") .successHandler(successHandler).and().logout().logoutUrl(adminContextPath + "/logout").and().httpBasic() diff --git a/pig-visual/pig-sentinel-dashboard/pom.xml b/pig-visual/pig-sentinel-dashboard/pom.xml index 86f4321d..89a859d8 100755 --- a/pig-visual/pig-sentinel-dashboard/pom.xml +++ b/pig-visual/pig-sentinel-dashboard/pom.xml @@ -12,6 +12,11 @@ pig-sentinel-dashboard jar + + + 2.7.7 + + @@ -76,6 +81,22 @@ + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot-dependencies.version} + pom + import + + + + + pig-sentinel-dashboard diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/DefaultAuthorizationInterceptor.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/DefaultAuthorizationInterceptor.java index df71ffd3..56c537c0 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/DefaultAuthorizationInterceptor.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/DefaultAuthorizationInterceptor.java @@ -19,8 +19,8 @@ import com.alibaba.csp.sentinel.dashboard.domain.Result; import com.alibaba.fastjson.JSON; import org.springframework.web.method.HandlerMethod; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.lang.reflect.Method; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/DefaultLoginAuthenticationFilter.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/DefaultLoginAuthenticationFilter.java index ca18284c..b8a864de 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/DefaultLoginAuthenticationFilter.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/DefaultLoginAuthenticationFilter.java @@ -20,9 +20,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.util.AntPathMatcher; -import jakarta.servlet.*; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/FakeAuthServiceImpl.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/FakeAuthServiceImpl.java index e17d1735..73c568e1 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/FakeAuthServiceImpl.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/FakeAuthServiceImpl.java @@ -18,7 +18,7 @@ package com.alibaba.csp.sentinel.dashboard.auth; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; /** * A fake AuthService implementation, which will pass all user auth checking. diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/LoginAuthenticationFilter.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/LoginAuthenticationFilter.java index fbfa92d0..b44f1119 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/LoginAuthenticationFilter.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/LoginAuthenticationFilter.java @@ -15,7 +15,7 @@ */ package com.alibaba.csp.sentinel.dashboard.auth; -import jakarta.servlet.Filter; +import javax.servlet.Filter; /** *

diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/SimpleWebAuthServiceImpl.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/SimpleWebAuthServiceImpl.java index ab4c937f..6bcfb354 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/SimpleWebAuthServiceImpl.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/SimpleWebAuthServiceImpl.java @@ -15,8 +15,8 @@ */ package com.alibaba.csp.sentinel.dashboard.auth; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpSession; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; /** * @author cdfive 不需要 diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/AuthConfiguration.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/AuthConfiguration.java index 4ee355ca..63ad89a2 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/AuthConfiguration.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/AuthConfiguration.java @@ -21,7 +21,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; @Configuration @EnableConfigurationProperties(AuthProperties.class) diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/WebConfig.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/WebConfig.java index 8859c459..1ec063f9 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/WebConfig.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/config/WebConfig.java @@ -31,8 +31,8 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import jakarta.annotation.PostConstruct; -import jakarta.servlet.Filter; +import javax.annotation.PostConstruct; +import javax.servlet.Filter; import java.util.Arrays; import java.util.HashSet; import java.util.Set; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java index 97ffb105..b372453b 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AppController.java @@ -23,7 +23,7 @@ import com.alibaba.csp.sentinel.dashboard.domain.vo.MachineInfoVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthController.java index 1d20b1f7..0954f38a 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/AuthController.java @@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; /** * @author cdfive diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayApiController.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayApiController.java index 5eab6233..32e18882 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayApiController.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/controller/gateway/GatewayApiController.java @@ -33,7 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; -import jakarta.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequest; import java.util.*; import static com.alibaba.csp.sentinel.adapter.gateway.common.SentinelGatewayConstants.*; diff --git a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppManagement.java b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppManagement.java index 2e171f3c..7733a516 100644 --- a/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppManagement.java +++ b/pig-visual/pig-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/discovery/AppManagement.java @@ -19,7 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; -import jakarta.annotation.PostConstruct; +import javax.annotation.PostConstruct; import java.util.List; import java.util.Set; diff --git a/pig-visual/pig-xxl-job-admin/pom.xml b/pig-visual/pig-xxl-job-admin/pom.xml index 0204817b..456e405e 100644 --- a/pig-visual/pig-xxl-job-admin/pom.xml +++ b/pig-visual/pig-xxl-job-admin/pom.xml @@ -11,6 +11,10 @@ xxl job admin 控制台内置方便开发 jar + + 2.7.7 + + @@ -37,8 +41,8 @@ spring-boot-starter-web - jakarta.servlet - jakarta.servlet-api + javax.servlet + javax.servlet-api @@ -79,6 +83,21 @@ + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot-dependencies.version} + pom + import + + + + diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java index 781819a3..4e78da0d 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java @@ -15,9 +15,9 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.RedirectView; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Map; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java index f7014a34..7c5be8e6 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java @@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.List; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java index 9028e6cd..3d31caa0 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobCodeController.java @@ -12,8 +12,8 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.List; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java index 4e2a21b6..f52e941b 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java @@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.*; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java index 27f98e13..02b88e43 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java @@ -26,8 +26,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.*; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java index acc039d9..d7225dd1 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java @@ -24,8 +24,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.HashMap; import java.util.List; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java index 48d04ef1..424bd470 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java @@ -16,8 +16,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java index e1e4b751..8ef39830 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java @@ -6,9 +6,9 @@ import org.springframework.stereotype.Component; import org.springframework.web.servlet.AsyncHandlerInterceptor; import org.springframework.web.servlet.ModelAndView; -import jakarta.servlet.http.Cookie; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.HashMap; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java index 820dd882..d74cef91 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java @@ -8,9 +8,9 @@ import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.AsyncHandlerInterceptor; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.Arrays; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java index fe1befc0..e0c18b59 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/WebMvcConfig.java @@ -4,7 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import jakarta.annotation.Resource; +import javax.annotation.Resource; /** * web mvc config diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java index 41ffbc36..904212a3 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java @@ -11,8 +11,8 @@ import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerExceptionResolver; import org.springframework.web.servlet.ModelAndView; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java index 4c1aaaf4..4c52796e 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java @@ -12,7 +12,7 @@ import org.slf4j.LoggerFactory; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Component; -import jakarta.mail.internet.MimeMessage; +import javax.mail.internet.MimeMessage; import java.text.MessageFormat; import java.util.Arrays; import java.util.HashSet; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java index 5af5bd26..cb101655 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java @@ -9,8 +9,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Component; -import jakarta.annotation.Resource; -import jakarta.sql.DataSource; +import javax.annotation.Resource; +import javax.sql.DataSource; import java.util.Arrays; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/XxlJobDynamicScheduler.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/XxlJobDynamicScheduler.java index 931fe88a..b321f6c7 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/XxlJobDynamicScheduler.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/old/XxlJobDynamicScheduler.java @@ -25,9 +25,9 @@ // import org.slf4j.LoggerFactory; // import org.springframework.util.Assert; // -// import jakarta.servlet.ServletException; -// import jakarta.servlet.http.HttpServletRequest; -// import jakarta.servlet.http.HttpServletResponse; +// import javax.servlet.ServletException; +// import javax.servlet.http.HttpServletRequest; +// import javax.servlet.http.HttpServletResponse; // import java.io.IOException; // import java.util.Date; // import java.util.concurrent.ConcurrentHashMap; diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/CookieUtil.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/CookieUtil.java index 53f27f75..b7f28ded 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/CookieUtil.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/CookieUtil.java @@ -1,8 +1,8 @@ package com.xxl.job.admin.core.util; -import jakarta.servlet.http.Cookie; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; /** * Cookie.Util diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java index 51ec881b..737d4f8a 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/service/LoginService.java @@ -9,9 +9,9 @@ import com.xxl.job.core.biz.model.ReturnT; import org.springframework.context.annotation.Configuration; import org.springframework.util.DigestUtils; -import jakarta.annotation.Resource; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.math.BigInteger; /** diff --git a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java index 46f7d290..5ce61ab1 100755 --- a/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java +++ b/pig-visual/pig-xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java @@ -19,7 +19,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; +import javax.annotation.Resource; import java.text.MessageFormat; import java.util.*; diff --git a/pom.xml b/pom.xml index 51ee688b..28cf5cbd 100755 --- a/pom.xml +++ b/pom.xml @@ -33,14 +33,14 @@ UTF-8 17 17 - 2.7.9 + 3.0.0-M7 1.0.0 3.6.0 2.2.2 2.3 3.1 1.10 - 2.1.0 + 3.1.0 3.0.0 3.0.3 2.3.1 @@ -64,7 +64,7 @@ - com.github.ulisesbocchio + io.springboot.plugin jasypt-spring-boot-starter ${jasypt.version} @@ -229,29 +229,19 @@ io.spring.javaformat spring-javaformat-maven-plugin ${spring.checkstyle.plugin} - - - validate - true - - validate - - - + + + validate + true + + validate + + + - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - dev @@ -265,4 +255,20 @@ + + + + snapshots + + https://oss.sonatype.org/content/repositories/snapshots/ + + + + release + + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + +