mirror of
https://gitee.com/xtoon/xtoon-cloud.git
synced 2025-12-30 11:02:27 +00:00
通用模块开发
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
<module>xtoon-common-web</module>
|
||||
<module>xtoon-common-log</module>
|
||||
<module>xtoon-common-swagger</module>
|
||||
<module>xtoon-common-tenant</module>
|
||||
</modules>
|
||||
|
||||
|
||||
|
||||
27
xtoon-common/xtoon-common-tenant/pom.xml
Normal file
27
xtoon-common/xtoon-common-tenant/pom.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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>
|
||||
<artifactId>xtoon-common</artifactId>
|
||||
<groupId>com.xtoon.cloud</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>xtoon-common-tenant</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xtoon.cloud</groupId>
|
||||
<artifactId>xtoon-common-core</artifactId>
|
||||
<version>${xtoon-cloud.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.xtoon.cloud.common.tenant.config;
|
||||
|
||||
import com.xtoon.cloud.common.tenant.util.TenantHandlerInterceptor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
*
|
||||
* @author haoxin
|
||||
* @date 2021-06-24
|
||||
**/
|
||||
@Configuration
|
||||
public class WebConfigurer extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Autowired
|
||||
private TenantHandlerInterceptor tenantHandlerInterceptor;
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(tenantHandlerInterceptor)
|
||||
.excludePathPatterns("/auth/*");
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.xtoon.cloud.common.web.util;
|
||||
package com.xtoon.cloud.common.tenant.util;
|
||||
|
||||
import com.xtoon.cloud.common.core.constant.CommonConstant;
|
||||
import com.xtoon.cloud.common.core.util.TenantContext;
|
||||
@@ -0,0 +1,3 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.xtoon.cloud.common.tenant.util.TenantHandlerInterceptor,\
|
||||
com.xtoon.cloud.common.tenant.config.WebConfigurer
|
||||
@@ -41,6 +41,11 @@
|
||||
<artifactId>xtoon-common-mybatis</artifactId>
|
||||
<version>${xtoon-cloud.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xtoon.cloud</groupId>
|
||||
<artifactId>xtoon-common-tenant</artifactId>
|
||||
<version>${xtoon-cloud.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xtoon.cloud</groupId>
|
||||
<artifactId>xtoon-common-log</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user