From 64d2dad9c1e05dfb461eea24a2f652a051e49dae Mon Sep 17 00:00:00 2001 From: huangxutao Date: Tue, 18 Jun 2019 18:54:57 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96ing.=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8=E6=8F=8F=E8=BF=B0=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A7=9F=E6=88=B7ID=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pigx/common/core/constant/CommonConstants.java | 6 ++++++ .../pigx/common/data/tenant/TenantContextHolderFilter.java | 2 +- .../src/main/resources/template/Controller.java.vm | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstants.java b/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstants.java index 155005237..d8229d99e 100644 --- a/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstants.java +++ b/pigx-common/pigx-common-core/src/main/java/com/pig4cloud/pigx/common/core/constant/CommonConstants.java @@ -28,6 +28,12 @@ public interface CommonConstants { * header 中租户ID */ String TENANT_ID = "TENANT_ID"; + + /** + * 租户ID + */ + Integer TENANT_ID_1 = 1; + /** * 删除 */ diff --git a/pigx-common/pigx-common-data/src/main/java/com/pig4cloud/pigx/common/data/tenant/TenantContextHolderFilter.java b/pigx-common/pigx-common-data/src/main/java/com/pig4cloud/pigx/common/data/tenant/TenantContextHolderFilter.java index 2587decb4..1bb60a77c 100644 --- a/pigx-common/pigx-common-data/src/main/java/com/pig4cloud/pigx/common/data/tenant/TenantContextHolderFilter.java +++ b/pigx-common/pigx-common-data/src/main/java/com/pig4cloud/pigx/common/data/tenant/TenantContextHolderFilter.java @@ -53,7 +53,7 @@ public class TenantContextHolderFilter extends GenericFilterBean { if (StrUtil.isNotBlank(tenantId)) { TenantContextHolder.setTenantId(Integer.parseInt(tenantId)); } else { - TenantContextHolder.setTenantId(1); + TenantContextHolder.setTenantId(CommonConstants.TENANT_ID_1); } filterChain.doFilter(request, response); diff --git a/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm b/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm index 9ed290840..089f552c2 100755 --- a/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm +++ b/pigx-visual/pigx-codegen/src/main/resources/template/Controller.java.vm @@ -40,7 +40,7 @@ import org.springframework.web.bind.annotation.*; @RestController @AllArgsConstructor @RequestMapping("/${pathName}" ) -@Api(value = "${pathName}", tags = "${pathName}管理") +@Api(value = "${pathName}", tags = "${comments}管理") public class ${className}Controller { private final ${className}Service ${classname}Service;