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;