✨ 添加新特性. pigx-common-feing 支持META-INF 自动导入
This commit is contained in:
1 parent
9f22f3e999
commit
f0d18f82d5
28 files changed
+389
-21
No files matched your search
@@ -53,6 +53,11 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!--feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!--mysql 驱动-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
package com.pig4cloud.pigx.auth;
|
||||
|
||||
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cloud.client.SpringCloudApplication;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018年06月21日
|
||||
* @date 2020-02-08
|
||||
* 认证授权中心
|
||||
*/
|
||||
@SpringCloudApplication
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<mysql.connector.version>8.0.18</mysql.connector.version>
|
||||
<swagger.core.version>1.5.22</swagger.core.version>
|
||||
<mp.weixin.version>3.6.0</mp.weixin.version>
|
||||
<ijpay.version>1.2.0</ijpay.version>
|
||||
<aliyun.version>3.0.52.ALL</aliyun.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@@ -78,6 +80,11 @@
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
<version>${pigx.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
<version>${pigx.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sequence</artifactId>
|
||||
@@ -144,6 +151,16 @@
|
||||
<artifactId>weixin-java-common</artifactId>
|
||||
<version>${mp.weixin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.javen205</groupId>
|
||||
<artifactId>IJPay</artifactId>
|
||||
<version>${ijpay.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>${aliyun.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
|
||||
+4
-1
@@ -20,6 +20,7 @@ package com.pig4cloud.pigx.common.data.mybatis;
|
||||
import com.baomidou.mybatisplus.core.parser.ISqlParser;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
|
||||
import com.pig4cloud.pigx.admin.api.feign.RemoteDataScopeService;
|
||||
import com.pig4cloud.pigx.common.data.datascope.DataScopeHandle;
|
||||
import com.pig4cloud.pigx.common.data.datascope.DataScopeInterceptor;
|
||||
import com.pig4cloud.pigx.common.data.datascope.PigxDefaultDatascopeHandle;
|
||||
@@ -38,7 +39,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2017/10/29
|
||||
* @date 2020-02-08
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnBean(DataSource.class)
|
||||
@@ -82,6 +83,7 @@ public class MybatisPlusConfig {
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
@ConditionalOnBean(RemoteDataScopeService.class)
|
||||
public DataScopeHandle dataScopeHandle() {
|
||||
return new PigxDefaultDatascopeHandle();
|
||||
}
|
||||
@@ -93,6 +95,7 @@ public class MybatisPlusConfig {
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
@ConditionalOnBean(DataScopeHandle.class)
|
||||
public DataScopeInterceptor dataScopeInterceptor() {
|
||||
return new DataScopeInterceptor(dataScopeHandle());
|
||||
}
|
||||
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common</artifactId>
|
||||
<version>3.7.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
<description>feign 通用组件</description>
|
||||
<dependencies>
|
||||
<!--feign 依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.feign;
|
||||
|
||||
import feign.Feign;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.cloud.openfeign.PigxFeignClientsRegistrar;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2020/2/8
|
||||
* <p>
|
||||
* feign 自动化配置
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(Feign.class)
|
||||
@Import(PigxFeignClientsRegistrar.class)
|
||||
@AutoConfigureAfter(EnableFeignClients.class)
|
||||
public class PigxFeignAutoConfiguration {
|
||||
|
||||
}
|
||||
+5
-2
@@ -15,20 +15,23 @@
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package com.pig4cloud.pigx.common.security.annotation;
|
||||
package com.pig4cloud.pigx.common.feign.annotation;
|
||||
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.cloud.openfeign.PigxFeignClientsRegistrar;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author lengleng
|
||||
* @date 2018/9/5
|
||||
* @date 2020-02-08
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@EnableFeignClients
|
||||
@Import(PigxFeignClientsRegistrar.class)
|
||||
public @interface EnablePigxFeignClients {
|
||||
/**
|
||||
* Alias for the {@link #basePackages()} attribute. Allows for more concise annotation
|
||||
+231
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025, lengleng All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the pig4cloud.com developer nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
* Author: lengleng (wangiegie@gmail.com)
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.openfeign;
|
||||
|
||||
import com.pig4cloud.pigx.common.feign.PigxFeignAutoConfiguration;
|
||||
import lombok.Getter;
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.config.BeanDefinitionHolder;
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.context.EnvironmentAware;
|
||||
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
|
||||
import org.springframework.core.annotation.AnnotatedElementUtils;
|
||||
import org.springframework.core.annotation.AnnotationAttributes;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.io.support.SpringFactoriesLoader;
|
||||
import org.springframework.core.type.AnnotationMetadata;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author L.cm
|
||||
* @date 2020/2/8
|
||||
* <p>
|
||||
* feign 自动配置功能 from mica
|
||||
*/
|
||||
public class PigxFeignClientsRegistrar implements ImportBeanDefinitionRegistrar, BeanClassLoaderAware, EnvironmentAware {
|
||||
@Getter
|
||||
private ClassLoader beanClassLoader;
|
||||
@Getter
|
||||
private Environment environment;
|
||||
|
||||
@Override
|
||||
public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry) {
|
||||
registerFeignClients(registry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
this.beanClassLoader = classLoader;
|
||||
}
|
||||
|
||||
private void registerFeignClients(BeanDefinitionRegistry registry) {
|
||||
List<String> feignClients = SpringFactoriesLoader.loadFactoryNames(getSpringFactoriesLoaderFactoryClass(), getBeanClassLoader());
|
||||
// 如果 spring.factories 里为空
|
||||
if (feignClients.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (String className : feignClients) {
|
||||
try {
|
||||
Class<?> clazz = beanClassLoader.loadClass(className);
|
||||
AnnotationAttributes attributes = AnnotatedElementUtils.getMergedAnnotationAttributes(clazz, FeignClient.class);
|
||||
if (attributes == null) {
|
||||
continue;
|
||||
}
|
||||
// 如果已经存在该 bean,支持原生的 Feign
|
||||
if (registry.containsBeanDefinition(className)) {
|
||||
continue;
|
||||
}
|
||||
registerClientConfiguration(registry, getClientName(attributes), attributes.get("configuration"));
|
||||
|
||||
validate(attributes);
|
||||
BeanDefinitionBuilder definition = BeanDefinitionBuilder.genericBeanDefinition(FeignClientFactoryBean.class);
|
||||
definition.addPropertyValue("url", getUrl(attributes));
|
||||
definition.addPropertyValue("path", getPath(attributes));
|
||||
String name = getName(attributes);
|
||||
definition.addPropertyValue("name", name);
|
||||
|
||||
// 兼容最新版本的 spring-cloud-openfeign,尚未发布
|
||||
StringBuilder aliasBuilder = new StringBuilder(18);
|
||||
if (attributes.containsKey("contextId")) {
|
||||
String contextId = getContextId(attributes);
|
||||
aliasBuilder.append(contextId);
|
||||
definition.addPropertyValue("contextId", contextId);
|
||||
} else {
|
||||
aliasBuilder.append(name);
|
||||
}
|
||||
|
||||
definition.addPropertyValue("type", className);
|
||||
definition.addPropertyValue("decode404", attributes.get("decode404"));
|
||||
definition.addPropertyValue("fallback", attributes.get("fallback"));
|
||||
definition.addPropertyValue("fallbackFactory", attributes.get("fallbackFactory"));
|
||||
definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
|
||||
|
||||
AbstractBeanDefinition beanDefinition = definition.getBeanDefinition();
|
||||
|
||||
// alias
|
||||
String alias = aliasBuilder.append("FeignClient").toString();
|
||||
|
||||
// has a default, won't be null
|
||||
boolean primary = (Boolean) attributes.get("primary");
|
||||
|
||||
beanDefinition.setPrimary(primary);
|
||||
|
||||
String qualifier = getQualifier(attributes);
|
||||
if (StringUtils.hasText(qualifier)) {
|
||||
alias = qualifier;
|
||||
}
|
||||
|
||||
BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDefinition, className, new String[]{alias});
|
||||
BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the class used by {@link SpringFactoriesLoader} to load configuration
|
||||
* candidates.
|
||||
*
|
||||
* @return the factory class
|
||||
*/
|
||||
private Class<?> getSpringFactoriesLoaderFactoryClass() {
|
||||
return PigxFeignAutoConfiguration.class;
|
||||
}
|
||||
|
||||
private void validate(Map<String, Object> attributes) {
|
||||
AnnotationAttributes annotation = AnnotationAttributes.fromMap(attributes);
|
||||
// This blows up if an aliased property is overspecified
|
||||
FeignClientsRegistrar.validateFallback(annotation.getClass("fallback"));
|
||||
FeignClientsRegistrar.validateFallbackFactory(annotation.getClass("fallbackFactory"));
|
||||
}
|
||||
|
||||
private String getName(Map<String, Object> attributes) {
|
||||
String name = (String) attributes.get("serviceId");
|
||||
if (!StringUtils.hasText(name)) {
|
||||
name = (String) attributes.get("name");
|
||||
}
|
||||
if (!StringUtils.hasText(name)) {
|
||||
name = (String) attributes.get("value");
|
||||
}
|
||||
name = resolve(name);
|
||||
return FeignClientsRegistrar.getName(name);
|
||||
}
|
||||
|
||||
private String getContextId(Map<String, Object> attributes) {
|
||||
String contextId = (String) attributes.get("contextId");
|
||||
if (!StringUtils.hasText(contextId)) {
|
||||
return getName(attributes);
|
||||
}
|
||||
|
||||
contextId = resolve(contextId);
|
||||
return FeignClientsRegistrar.getName(contextId);
|
||||
}
|
||||
|
||||
private String resolve(String value) {
|
||||
if (StringUtils.hasText(value)) {
|
||||
return this.environment.resolvePlaceholders(value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private String getUrl(Map<String, Object> attributes) {
|
||||
String url = resolve((String) attributes.get("url"));
|
||||
return FeignClientsRegistrar.getUrl(url);
|
||||
}
|
||||
|
||||
private String getPath(Map<String, Object> attributes) {
|
||||
String path = resolve((String) attributes.get("path"));
|
||||
return FeignClientsRegistrar.getPath(path);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getQualifier(@Nullable Map<String, Object> client) {
|
||||
if (client == null) {
|
||||
return null;
|
||||
}
|
||||
String qualifier = (String) client.get("qualifier");
|
||||
if (StringUtils.hasText(qualifier)) {
|
||||
return qualifier;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getClientName(@Nullable Map<String, Object> client) {
|
||||
if (client == null) {
|
||||
return null;
|
||||
}
|
||||
String value = (String) client.get("contextId");
|
||||
if (!StringUtils.hasText(value)) {
|
||||
value = (String) client.get("value");
|
||||
}
|
||||
if (!StringUtils.hasText(value)) {
|
||||
value = (String) client.get("name");
|
||||
}
|
||||
if (!StringUtils.hasText(value)) {
|
||||
value = (String) client.get("serviceId");
|
||||
}
|
||||
if (StringUtils.hasText(value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
throw new IllegalStateException("Either 'name' or 'value' must be provided in @" + FeignClient.class.getSimpleName());
|
||||
}
|
||||
|
||||
private void registerClientConfiguration(BeanDefinitionRegistry registry, Object name, Object configuration) {
|
||||
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(FeignClientSpecification.class);
|
||||
builder.addConstructorArgValue(name);
|
||||
builder.addConstructorArgValue(configuration);
|
||||
registry.registerBeanDefinition(name + "." + FeignClientSpecification.class.getSimpleName(), builder.getBeanDefinition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnvironment(Environment environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.pig4cloud.pigx.common.feign.PigxFeignAutoConfiguration
|
||||
@@ -43,6 +43,11 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-oauth2</artifactId>
|
||||
</dependency>
|
||||
<!--feign-->
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-core</artifactId>
|
||||
</dependency>
|
||||
<!--UPMS API-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import javax.annotation.PostConstruct;
|
||||
* sentinel 配置
|
||||
*/
|
||||
@Configuration
|
||||
public class SentinelAutoConfigure {
|
||||
public class SentinelAutoConfiguration {
|
||||
|
||||
@PostConstruct
|
||||
public void initWebCallbackManager() {
|
||||
@@ -1,2 +1,2 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.pig4cloud.pigx.common.sentinel.SentinelAutoConfigure
|
||||
com.pig4cloud.pigx.common.sentinel.SentinelAutoConfiguration
|
||||
@@ -37,6 +37,7 @@
|
||||
<module>pigx-common-core</module>
|
||||
<module>pigx-common-data</module>
|
||||
<module>pigx-common-datasource</module>
|
||||
<module>pigx-common-feign</module>
|
||||
<module>pigx-common-gateway</module>
|
||||
<module>pigx-common-gray</module>
|
||||
<module>pigx-common-job</module>
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
</dependency>
|
||||
<!--sentinel-->
|
||||
<!--feign 工具类-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,7 @@
|
||||
# 配置 feignclient 的全类名路径, 避免包名不规范无法扫描问题
|
||||
com.pig4cloud.pigx.common.feign.PigxFeignAutoConfiguration=\
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteDataScopeService,\
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteLogService,\
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteTenantService,\
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteTokenService,\
|
||||
com.pig4cloud.pigx.admin.api.feign.RemoteUserService
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
package com.pig4cloud.pigx.admin;
|
||||
|
||||
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
||||
@@ -64,6 +64,11 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!--sentinel-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@
|
||||
package com.pig4cloud.pigx.codegen;
|
||||
|
||||
import com.pig4cloud.pigx.common.datasource.annotation.EnableDynamicDataSource;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -31,8 +31,8 @@ import org.springframework.cloud.client.SpringCloudApplication;
|
||||
*/
|
||||
@EnableDynamicDataSource
|
||||
@EnablePigxSwagger2
|
||||
@SpringCloudApplication
|
||||
@EnablePigxFeignClients
|
||||
@SpringCloudApplication
|
||||
@EnablePigxResourceServer
|
||||
public class PigxCodeGenApplication {
|
||||
|
||||
|
||||
@@ -86,6 +86,11 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!-- sentinel-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--灰度支持-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
|
||||
+1
-1
@@ -17,8 +17,8 @@
|
||||
|
||||
package com.pig4cloud.pigx.daemon.elastic;
|
||||
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.gray.annotation.EnablePigxXxlJob;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
||||
@@ -59,6 +59,11 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<!-- sentinel-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--灰度支持-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.pig4cloud.pigx.daemon.quartz;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -12,8 +12,8 @@ import org.springframework.cloud.client.SpringCloudApplication;
|
||||
* 定时任务模块
|
||||
*/
|
||||
@EnablePigxSwagger2
|
||||
@SpringCloudApplication
|
||||
@EnablePigxFeignClients
|
||||
@SpringCloudApplication
|
||||
@EnablePigxResourceServer
|
||||
public class PigxDaemonQuartzApplication {
|
||||
|
||||
|
||||
@@ -63,6 +63,11 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-log</artifactId>
|
||||
</dependency>
|
||||
<!-- sentinel-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--灰度支持-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.mp;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@@ -29,8 +29,8 @@ import org.springframework.cloud.client.SpringCloudApplication;
|
||||
* 微信公众号管理模块
|
||||
*/
|
||||
@EnablePigxSwagger2
|
||||
@SpringCloudApplication
|
||||
@EnablePigxFeignClients
|
||||
@SpringCloudApplication
|
||||
@EnablePigxResourceServer
|
||||
public class PigxMpPlatformApplication {
|
||||
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-upms-api</artifactId>
|
||||
</dependency>
|
||||
<!--sentinel-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--灰度支持-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
@@ -136,6 +141,10 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-feign</artifactId>
|
||||
</dependency>
|
||||
<!--undertow容器-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.act;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
||||
@@ -53,6 +53,11 @@
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-gray</artifactId>
|
||||
</dependency>
|
||||
<!-- sentinel-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
<artifactId>pigx-common-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!--feign 接口-->
|
||||
<dependency>
|
||||
<groupId>com.pig4cloud</groupId>
|
||||
@@ -76,12 +81,10 @@
|
||||
<dependency>
|
||||
<groupId>com.github.javen205</groupId>
|
||||
<artifactId>IJPay</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>3.0.52.ALL</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.pay;
|
||||
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.feign.annotation.EnablePigxFeignClients;
|
||||
import com.pig4cloud.pigx.common.security.annotation.EnablePigxResourceServer;
|
||||
import com.pig4cloud.pigx.common.swagger.annotation.EnablePigxSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
||||
Reference in new issue
Block a user