Browse Source

🎉 增加多租户数据库隔离、动态数据源切换功能

test
smallchill 5 years ago
parent
commit
a0ca1e6e72
  1. 2
      blade-auth/src/main/java/org/springblade/auth/endpoint/BladeSocialEndpoint.java
  2. 2
      blade-auth/src/main/java/org/springblade/auth/endpoint/BladeTokenEndPoint.java
  3. 2
      blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java
  4. 4
      blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java
  5. 4
      blade-ops/blade-flow/src/main/java/org/springblade/flow/business/controller/WorkController.java
  6. 2
      blade-ops/blade-flow/src/main/java/org/springblade/flow/business/feign/FlowClient.java
  7. 4
      blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/controller/FlowFollowController.java
  8. 2
      blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/controller/FlowManagerController.java
  9. 2
      blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/controller/FlowModelController.java
  10. 2
      blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/controller/FlowProcessController.java
  11. 2
      blade-ops/blade-log/src/main/java/org/springblade/core/log/controller/LogApiController.java
  12. 2
      blade-ops/blade-log/src/main/java/org/springblade/core/log/controller/LogErrorController.java
  13. 2
      blade-ops/blade-log/src/main/java/org/springblade/core/log/controller/LogUsualController.java
  14. 6
      blade-ops/blade-log/src/main/java/org/springblade/core/log/feign/LogClient.java
  15. 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/AttachController.java
  16. 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/OssController.java
  17. 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/SmsController.java
  18. 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java
  19. 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/SmsEndpoint.java
  20. 2
      blade-ops/blade-resource/src/main/java/org/springblade/resource/feign/SmsClient.java
  21. 5
      blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java
  22. 4
      blade-service/blade-desk/src/main/java/org/springblade/desk/controller/DashBoardController.java
  23. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/controller/LeaveController.java
  24. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java
  25. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java
  26. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/ApiScopeController.java
  27. 4
      blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java
  28. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java
  29. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java
  30. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/DictBizController.java
  31. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java
  32. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java
  33. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java
  34. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java
  35. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/RegionController.java
  36. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java
  37. 24
      blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java
  38. 2
      blade-service/blade-system/src/main/java/org/springblade/system/controller/TopMenuController.java
  39. 2
      blade-service/blade-system/src/main/java/org/springblade/system/feign/ApiScopeClient.java
  40. 2
      blade-service/blade-system/src/main/java/org/springblade/system/feign/DataScopeClient.java
  41. 2
      blade-service/blade-system/src/main/java/org/springblade/system/feign/DictBizClient.java
  42. 2
      blade-service/blade-system/src/main/java/org/springblade/system/feign/DictClient.java
  43. 2
      blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java
  44. 2
      blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java
  45. 2
      blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java
  46. 4
      doc/nacos/blade.yaml
  47. 1
      doc/sql/db/database-info.md
  48. 3
      doc/sql/mysql/bladex-saber-mysql.sql
  49. 3
      doc/sql/mysql/bladex-sword-mysql.sql
  50. 4
      doc/sql/oracle/bladex-saber-oracle.sql
  51. 2
      doc/sql/oracle/bladex-sword-oracle.sql
  52. 4
      doc/sql/postgresql/bladex-saber-postgresql.sql
  53. 4
      doc/sql/postgresql/bladex-sword-postgresql.sql
  54. 10
      doc/sql/sqlserver/bladex-saber-sqlserver.sql
  55. 10
      doc/sql/sqlserver/bladex-sword-sqlserver.sql
  56. 6
      doc/sql/update/mysql-update-2.5.1~2.5.2.sql
  57. 7
      doc/sql/update/oracle-update-2.5.1~2.5.2.sql
  58. 7
      doc/sql/update/postgresql-update-2.5.1~2.5.2.sql

2
blade-auth/src/main/java/org/springblade/auth/endpoint/BladeSocialEndpoint.java

@ -24,6 +24,7 @@ import me.zhyd.oauth.request.AuthRequest;
import me.zhyd.oauth.utils.AuthStateUtils;
import org.springblade.core.social.props.SocialProperties;
import org.springblade.core.social.utils.SocialUtil;
import org.springblade.core.tenant.annotation.NonDS;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@ -37,6 +38,7 @@ import java.io.IOException;
*
* @author Chill
*/
@NonDS
@Slf4j
@RestController
@AllArgsConstructor

2
blade-auth/src/main/java/org/springblade/auth/endpoint/BladeTokenEndPoint.java

@ -28,6 +28,7 @@ import org.springblade.core.launch.constant.TokenConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.StringUtil;
@ -43,6 +44,7 @@ import java.time.Duration;
*
* @author Chill
*/
@NonDS
@Slf4j
@RestController
@AllArgsConstructor

2
blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/CodeController.java

@ -24,6 +24,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.Func;
@ -44,6 +45,7 @@ import java.util.Map;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/code")

4
blade-ops/blade-develop/src/main/java/org/springblade/develop/controller/DatasourceController.java

@ -17,14 +17,15 @@
package org.springblade.develop.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.develop.entity.Datasource;
@ -39,6 +40,7 @@ import java.util.List;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/datasource")

4
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/controller/WorkController.java

@ -17,14 +17,15 @@
package org.springblade.flow.business.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.flowable.engine.TaskService;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.flow.business.service.FlowBusinessService;
import org.springblade.flow.core.entity.BladeFlow;
@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.*;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("work")

2
blade-ops/blade-flow/src/main/java/org/springblade/flow/business/feign/FlowClient.java

@ -21,6 +21,7 @@ import org.flowable.engine.IdentityService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.runtime.ProcessInstance;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.Func;
@ -40,6 +41,7 @@ import java.util.Map;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
public class FlowClient implements IFlowClient {

4
blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/controller/FlowFollowController.java

@ -17,13 +17,14 @@
package org.springblade.flow.engine.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.flow.engine.entity.FlowExecution;
@ -35,6 +36,7 @@ import org.springframework.web.bind.annotation.*;
*
* @author Chill
*/
@NonDS
@RestController
@RequestMapping("follow")
@AllArgsConstructor

2
blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/controller/FlowManagerController.java

@ -25,6 +25,7 @@ import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.support.Kv;
@ -43,6 +44,7 @@ import java.util.Objects;
*
* @author Chill
*/
@NonDS
@RestController
@RequestMapping("manager")
@AllArgsConstructor

2
blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/controller/FlowModelController.java

@ -26,6 +26,7 @@ import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.Func;
@ -41,6 +42,7 @@ import java.util.Map;
*
* @author Chill
*/
@NonDS
@RestController
@RequestMapping("model")
@AllArgsConstructor

2
blade-ops/blade-flow/src/main/java/org/springblade/flow/engine/controller/FlowProcessController.java

@ -26,6 +26,7 @@ import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.image.ProcessDiagramGenerator;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.flow.core.entity.BladeFlow;
@ -47,6 +48,7 @@ import java.util.List;
*
* @author Chill
*/
@NonDS
@Slf4j
@RestController
@AllArgsConstructor

2
blade-ops/blade-log/src/main/java/org/springblade/core/log/controller/LogApiController.java

@ -23,6 +23,7 @@ import org.springblade.core.log.model.LogApi;
import org.springblade.core.log.service.ILogApiService;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -37,6 +38,7 @@ import java.util.Map;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/api")

2
blade-ops/blade-log/src/main/java/org/springblade/core/log/controller/LogErrorController.java

@ -23,6 +23,7 @@ import org.springblade.core.log.model.LogError;
import org.springblade.core.log.service.ILogErrorService;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -37,6 +38,7 @@ import java.util.Map;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/error")

2
blade-ops/blade-log/src/main/java/org/springblade/core/log/controller/LogUsualController.java

@ -23,6 +23,7 @@ import org.springblade.core.log.model.LogUsual;
import org.springblade.core.log.service.ILogUsualService;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -37,6 +38,7 @@ import java.util.Map;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/usual")

6
blade-ops/blade-log/src/main/java/org/springblade/core/log/feign/LogClient.java

@ -18,11 +18,12 @@ package org.springblade.core.log.feign;
import lombok.AllArgsConstructor;
import org.springblade.core.log.model.LogApi;
import org.springblade.core.log.model.LogUsual;
import org.springblade.core.log.model.LogError;
import org.springblade.core.log.model.LogUsual;
import org.springblade.core.log.service.ILogApiService;
import org.springblade.core.log.service.ILogUsualService;
import org.springblade.core.log.service.ILogErrorService;
import org.springblade.core.log.service.ILogUsualService;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -33,6 +34,7 @@ import org.springframework.web.bind.annotation.RestController;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
public class LogClient implements ILogClient {

2
blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/AttachController.java

@ -25,6 +25,7 @@ import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.resource.entity.Attach;
@ -39,6 +40,7 @@ import javax.validation.Valid;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/attach")

2
blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/OssController.java

@ -27,6 +27,7 @@ import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.Func;
@ -46,6 +47,7 @@ import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE;
*
* @author BladeX
*/
@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor

2
blade-ops/blade-resource/src/main/java/org/springblade/resource/controller/SmsController.java

@ -27,6 +27,7 @@ import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.Func;
@ -46,6 +47,7 @@ import static org.springblade.core.cache.constant.CacheConstant.RESOURCE_CACHE;
*
* @author BladeX
*/
@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor

2
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/OssEndpoint.java

@ -22,6 +22,7 @@ import lombok.SneakyThrows;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.oss.model.OssFile;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.FileUtil;
@ -37,6 +38,7 @@ import org.springframework.web.multipart.MultipartFile;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/oss/endpoint")

2
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/SmsEndpoint.java

@ -22,6 +22,7 @@ import lombok.SneakyThrows;
import org.springblade.core.sms.model.SmsCode;
import org.springblade.core.sms.model.SmsData;
import org.springblade.core.sms.model.SmsResponse;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.Func;
@ -41,6 +42,7 @@ import static org.springblade.resource.utils.SmsUtil.*;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/sms/endpoint")

2
blade-ops/blade-resource/src/main/java/org/springblade/resource/feign/SmsClient.java

@ -20,6 +20,7 @@ import lombok.AllArgsConstructor;
import org.springblade.core.sms.model.SmsCode;
import org.springblade.core.sms.model.SmsData;
import org.springblade.core.sms.model.SmsResponse;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.Func;
@ -36,6 +37,7 @@ import static org.springblade.resource.utils.SmsUtil.*;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
public class SmsClient implements ISmsClient {

5
blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Tenant.java

@ -88,6 +88,11 @@ public class Tenant extends BaseEntity {
@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
@ApiModelProperty(value = "过期时间")
private Date expireTime;
/**
* 数据源ID
*/
@ApiModelProperty(value = "数据源ID")
private Long datasourceId;
/**
* 授权码
*/

4
blade-service/blade-desk/src/main/java/org/springblade/desk/controller/DashBoardController.java

@ -1,9 +1,10 @@
package org.springblade.desk.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.support.Kv;
import org.springframework.web.bind.annotation.GetMapping;
@ -19,6 +20,7 @@ import java.util.Map;
*
* @author zhuangqian
*/
@NonDS
@RestController
@AllArgsConstructor
@Api(value = "首页", tags = "首页")

2
blade-service/blade-desk/src/main/java/org/springblade/desk/controller/LeaveController.java

@ -19,6 +19,7 @@ package org.springblade.desk.controller;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.CacheNames;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.desk.entity.ProcessLeave;
import org.springblade.desk.service.ILeaveService;
@ -31,6 +32,7 @@ import springfox.documentation.annotations.ApiIgnore;
*
* @author Chill
*/
@NonDS
@ApiIgnore
@RestController
@RequestMapping("/process/leave")

2
blade-service/blade-desk/src/main/java/org/springblade/desk/controller/NoticeController.java

@ -24,6 +24,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.TenantDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.desk.entity.Notice;
@ -41,6 +42,7 @@ import java.util.Map;
*
* @author Chill
*/
@TenantDS
@RestController
@RequestMapping("notice")
@AllArgsConstructor

2
blade-service/blade-desk/src/main/java/org/springblade/desk/feign/NoticeClient.java

@ -21,6 +21,7 @@ import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.desk.entity.Notice;
import org.springblade.desk.service.INoticeService;
import org.springframework.web.bind.annotation.GetMapping;
@ -32,6 +33,7 @@ import springfox.documentation.annotations.ApiIgnore;
*
* @author Chill
*/
@NonDS
@ApiIgnore()
@RestController
@AllArgsConstructor

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/ApiScopeController.java

@ -26,6 +26,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.ApiScope;
@ -43,6 +44,7 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
*
* @author BladeX
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("api-scope")

4
blade-service/blade-system/src/main/java/org/springblade/system/controller/AuthClientController.java

@ -17,15 +17,16 @@
package org.springblade.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.Func;
@ -41,6 +42,7 @@ import javax.validation.Valid;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/client")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/DataScopeController.java

@ -26,6 +26,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.DataScope;
@ -43,6 +44,7 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
*
* @author BladeX
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("data-scope")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/DeptController.java

@ -25,6 +25,7 @@ import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.constant.RoleConstant;
@ -50,6 +51,7 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/dept")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/DictBizController.java

@ -24,6 +24,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.service.IDictBizService;
@ -43,6 +44,7 @@ import static org.springblade.core.cache.constant.CacheConstant.DICT_CACHE;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/dict-biz")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/DictController.java

@ -24,6 +24,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Dict;
import org.springblade.system.service.IDictService;
@ -44,6 +45,7 @@ import static org.springblade.core.cache.constant.CacheConstant.DICT_CACHE;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/dict")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/MenuController.java

@ -25,6 +25,7 @@ import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.support.Kv;
@ -52,6 +53,7 @@ import static org.springblade.core.cache.constant.CacheConstant.MENU_CACHE;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/menu")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/ParamController.java

@ -24,6 +24,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Param;
@ -41,6 +42,7 @@ import static org.springblade.core.cache.constant.CacheConstant.PARAM_CACHE;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/param")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/PostController.java

@ -28,6 +28,7 @@ import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.Post;
@ -46,6 +47,7 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/post")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/RegionController.java

@ -26,6 +26,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.system.entity.Region;
@ -49,6 +50,7 @@ import java.util.Map;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/region")

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/RoleController.java

@ -25,6 +25,7 @@ import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.constant.RoleConstant;
@ -48,6 +49,7 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/role")

24
blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java

@ -23,10 +23,12 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.constant.RoleConstant;
@ -42,15 +44,19 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import static org.springblade.core.tenant.constant.TenantBaseConstant.TENANT_DATASOURCE_CACHE;
import static org.springblade.core.tenant.constant.TenantBaseConstant.TENANT_DATASOURCE_EXIST_KEY;
/**
* 控制器
*
* @author Chill
*/
@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor
@RequestMapping("/tenant")
@ApiIgnore
@Api(value = "租户管理", tags = "接口")
public class TenantController extends BladeController {
@ -145,13 +151,25 @@ public class TenantController extends BladeController {
return R.status(tenantService.setting(accountNumber, expireTime, ids));
}
/**
* 数据源配置
*/
@PostMapping("datasource")
@ApiOperationSupport(order = 8)
@PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR)
@ApiOperation(value = "数据源配置", notes = "传入datasource_id")
public R datasource(@ApiParam(value = "租户ID", required = true) @RequestParam String tenantId, @ApiParam(value = "数据源ID", required = true) @RequestParam Long datasourceId){
CacheUtil.evict(TENANT_DATASOURCE_CACHE, TENANT_DATASOURCE_EXIST_KEY, tenantId, Boolean.FALSE);
return R.status(tenantService.update(Wrappers.<Tenant>update().lambda().set(Tenant::getDatasourceId, datasourceId).eq(Tenant::getTenantId, tenantId)));
}
/**
* 根据名称查询列表
*
* @param name 租户名称
*/
@GetMapping("/find-by-name")
@ApiOperationSupport(order = 8)
@ApiOperationSupport(order = 9)
@ApiOperation(value = "详情", notes = "传入tenant")
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
public R<List<Tenant>> findByName(String name) {
@ -165,7 +183,7 @@ public class TenantController extends BladeController {
* @param domain 域名
*/
@GetMapping("/info")
@ApiOperationSupport(order = 9)
@ApiOperationSupport(order = 10)
@ApiOperation(value = "配置信息", notes = "传入domain")
public R<Kv> info(String domain) {
Tenant tenant = tenantService.getOne(Wrappers.<Tenant>query().lambda().eq(Tenant::getDomain, domain));

2
blade-service/blade-system/src/main/java/org/springblade/system/controller/TopMenuController.java

@ -27,6 +27,7 @@ import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.RoleConstant;
import org.springblade.core.tool.utils.Func;
@ -44,6 +45,7 @@ import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE;
*
* @author BladeX
*/
@NonDS
@RestController
@AllArgsConstructor
@RequestMapping("/topmenu")

2
blade-service/blade-system/src/main/java/org/springblade/system/feign/ApiScopeClient.java

@ -17,6 +17,7 @@
package org.springblade.system.feign;
import lombok.RequiredArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.utils.Func;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
@ -35,6 +36,7 @@ import static org.springblade.core.secure.constant.PermissionConstant.permission
*
* @author Chill
*/
@NonDS
@ApiIgnore
@RestController
@RequiredArgsConstructor

2
blade-service/blade-system/src/main/java/org/springblade/system/feign/DataScopeClient.java

@ -19,6 +19,7 @@ package org.springblade.system.feign;
import lombok.RequiredArgsConstructor;
import org.springblade.core.datascope.constant.DataScopeConstant;
import org.springblade.core.datascope.model.DataScopeModel;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
@ -36,6 +37,7 @@ import java.util.List;
*
* @author Chill
*/
@NonDS
@ApiIgnore
@RestController
@RequiredArgsConstructor

2
blade-service/blade-system/src/main/java/org/springblade/system/feign/DictBizClient.java

@ -18,6 +18,7 @@ package org.springblade.system.feign;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.service.IDictBizService;
@ -33,6 +34,7 @@ import java.util.List;
*
* @author Chill
*/
@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor

2
blade-service/blade-system/src/main/java/org/springblade/system/feign/DictClient.java

@ -18,6 +18,7 @@ package org.springblade.system.feign;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.Dict;
import org.springblade.system.service.IDictService;
@ -33,6 +34,7 @@ import java.util.List;
*
* @author Chill
*/
@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor

2
blade-service/blade-system/src/main/java/org/springblade/system/feign/SysClient.java

@ -17,6 +17,7 @@
package org.springblade.system.feign;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.system.entity.*;
import org.springblade.system.service.*;
@ -31,6 +32,7 @@ import java.util.List;
*
* @author Chill
*/
@NonDS
@ApiIgnore
@RestController
@AllArgsConstructor

2
blade-service/blade-user/src/main/java/org/springblade/system/user/controller/UserController.java

@ -32,6 +32,7 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.annotation.PreAuth;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.constant.RoleConstant;
@ -60,6 +61,7 @@ import static org.springblade.core.cache.constant.CacheConstant.USER_CACHE;
*
* @author Chill
*/
@NonDS
@RestController
@RequestMapping
@AllArgsConstructor

2
blade-service/blade-user/src/main/java/org/springblade/system/user/feign/UserClient.java

@ -18,6 +18,7 @@ package org.springblade.system.user.feign;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.user.entity.User;
@ -34,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
*
* @author Chill
*/
@NonDS
@RestController
@AllArgsConstructor
public class UserClient implements IUserClient {

4
doc/nacos/blade.yaml

@ -127,6 +127,10 @@ blade:
enhance: true
#多租户授权保护
license: false
#动态数据源功能
dynamic-datasource: false
#动态数据源全局扫描
dynamic-global: false
#多租户字段名
column: tenant_id
#排除多租户逻辑

1
doc/sql/db/database-info.md

@ -437,6 +437,7 @@ Table: blade_tenant(租户表)
| address | VARCHAR(255) | YES | | | 联系地址 |
| account_number | INT(10) | YES | | -1 | 账号额度 |
| expire_time | DATETIME(19) | YES | | | 过期时间 |
| datasource | BIGINT(19) | YES | | | 数据源ID |
| license_key | VARCHAR(1000) | YES | | | 授权码 |
| create_user | BIGINT(19) | YES | | | 创建人 |
| create_dept | BIGINT(19) | YES | | | 创建部门 |

3
doc/sql/mysql/bladex-saber-mysql.sql

@ -623,6 +623,7 @@ CREATE TABLE `blade_tenant` (
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系地址',
`account_number` int(11) NULL DEFAULT -1 COMMENT '账号额度',
`expire_time` datetime(0) NULL DEFAULT NULL COMMENT '过期时间',
`datasource_id` bigint(64) NULL DEFAULT NULL COMMENT '数据源ID',
`license_key` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '授权码',
`create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(64) NULL DEFAULT NULL COMMENT '创建部门',
@ -638,7 +639,7 @@ CREATE TABLE `blade_tenant` (
-- Records of blade_tenant
-- ----------------------------
BEGIN;
INSERT INTO `blade_tenant` VALUES (1123598820738675201, '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', -1, NULL, NULL, 1123598821738675201, 1123598813738675201, '2019-01-01 00:00:39', 1123598821738675201, '2019-01-01 00:00:39', 1, 0);
INSERT INTO `blade_tenant` VALUES (1123598820738675201, '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', -1, NULL, NULL, NULL, 1123598821738675201, 1123598813738675201, '2019-01-01 00:00:39', 1123598821738675201, '2019-01-01 00:00:39', 1, 0);
COMMIT;
-- ----------------------------

3
doc/sql/mysql/bladex-sword-mysql.sql

@ -623,6 +623,7 @@ CREATE TABLE `blade_tenant` (
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系地址',
`account_number` int(11) NULL DEFAULT -1 COMMENT '账号额度',
`expire_time` datetime(0) NULL DEFAULT NULL COMMENT '过期时间',
`datasource_id` bigint(64) NULL DEFAULT NULL COMMENT '数据源ID',
`license_key` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '授权码',
`create_user` bigint(64) NULL DEFAULT NULL COMMENT '创建人',
`create_dept` bigint(64) NULL DEFAULT NULL COMMENT '创建部门',
@ -638,7 +639,7 @@ CREATE TABLE `blade_tenant` (
-- Records of blade_tenant
-- ----------------------------
BEGIN;
INSERT INTO `blade_tenant` VALUES (1123598820738675201, '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', -1, NULL, NULL, 1123598821738675201, 1123598813738675201, '2019-01-01 00:00:39', 1123598821738675201, '2019-01-01 00:00:39', 1, 0);
INSERT INTO `blade_tenant` VALUES (1123598820738675201, '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', -1, NULL, NULL, NULL, 1123598821738675201, 1123598813738675201, '2019-01-01 00:00:39', 1123598821738675201, '2019-01-01 00:00:39', 1, 0);
COMMIT;
-- ----------------------------

4
doc/sql/oracle/bladex-saber-oracle.sql

@ -4992,6 +4992,7 @@ CREATE TABLE "BLADE_TENANT" (
"ADDRESS" NVARCHAR2(255) ,
"ACCOUNT_NUMBER" NUMBER DEFAULT -1 ,
"EXPIRE_TIME" DATE ,
"DATASOURCE_ID" NUMBER(20) ,
"LICENSE_KEY" VARCHAR2(1000 BYTE) ,
"CREATE_USER" NUMBER(20) ,
"CREATE_DEPT" NUMBER(20) ,
@ -5027,6 +5028,7 @@ COMMENT ON COLUMN "BLADE_TENANT"."CONTACT_NUMBER" IS '联系电话';
COMMENT ON COLUMN "BLADE_TENANT"."ADDRESS" IS '联系地址';
COMMENT ON COLUMN "BLADE_TENANT"."ACCOUNT_NUMBER" IS '账号额度';
COMMENT ON COLUMN "BLADE_TENANT"."EXPIRE_TIME" IS '过期时间';
COMMENT ON COLUMN "BLADE_TENANT"."DATASOURCE_ID" IS '数据源ID';
COMMENT ON COLUMN "BLADE_TENANT"."LICENSE_KEY" IS '授权码';
COMMENT ON COLUMN "BLADE_TENANT"."CREATE_USER" IS '创建人';
COMMENT ON COLUMN "BLADE_TENANT"."CREATE_DEPT" IS '创建部门';
@ -5040,7 +5042,7 @@ COMMENT ON TABLE "BLADE_TENANT" IS '租户表';
-- ----------------------------
-- Records of BLADE_TENANT
-- ----------------------------
INSERT INTO "BLADE_TENANT" VALUES ('1123598820738675201', '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', '-1', NULL, NULL, '1123598821738675201', '1123598813738675201', TO_DATE('2019-01-01 00:00:39', 'SYYYY-MM-DD HH24:MI:SS'), '1123598821738675201', TO_DATE('2019-01-01 00:00:39', 'SYYYY-MM-DD HH24:MI:SS'), '1', '0');
INSERT INTO "BLADE_TENANT" VALUES ('1123598820738675201', '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', '-1', NULL, NULL, NULL, '1123598821738675201', '1123598813738675201', TO_DATE('2019-01-01 00:00:39', 'SYYYY-MM-DD HH24:MI:SS'), '1123598821738675201', TO_DATE('2019-01-01 00:00:39', 'SYYYY-MM-DD HH24:MI:SS'), '1', '0');
COMMIT;
-- ----------------------------

2
doc/sql/oracle/bladex-sword-oracle.sql

@ -4990,6 +4990,7 @@ CREATE TABLE "BLADE_TENANT" (
"ADDRESS" NVARCHAR2(255) ,
"ACCOUNT_NUMBER" NUMBER DEFAULT -1 ,
"EXPIRE_TIME" DATE ,
"DATASOURCE_ID" NUMBER(20) ,
"LICENSE_KEY" VARCHAR2(1000 BYTE) ,
"CREATE_USER" NUMBER(20) ,
"CREATE_DEPT" NUMBER(20) ,
@ -5025,6 +5026,7 @@ COMMENT ON COLUMN "BLADE_TENANT"."CONTACT_NUMBER" IS '联系电话';
COMMENT ON COLUMN "BLADE_TENANT"."ADDRESS" IS '联系地址';
COMMENT ON COLUMN "BLADE_TENANT"."ACCOUNT_NUMBER" IS '账号额度';
COMMENT ON COLUMN "BLADE_TENANT"."EXPIRE_TIME" IS '过期时间';
COMMENT ON COLUMN "BLADE_TENANT"."DATASOURCE_ID" IS '数据源ID';
COMMENT ON COLUMN "BLADE_TENANT"."LICENSE_KEY" IS '授权码';
COMMENT ON COLUMN "BLADE_TENANT"."CREATE_USER" IS '创建人';
COMMENT ON COLUMN "BLADE_TENANT"."CREATE_DEPT" IS '创建部门';

4
doc/sql/postgresql/bladex-saber-postgresql.sql

@ -4664,6 +4664,7 @@ CREATE TABLE "blade_tenant" (
"address" varchar(255) COLLATE "pg_catalog"."default",
"account_number" int2 DEFAULT '-1'::integer,
"expire_time" timestamp(6),
"datasource_id" int8,
"license_key" varchar(1000) COLLATE "pg_catalog"."default",
"create_user" int8,
"create_dept" int8,
@ -4684,6 +4685,7 @@ COMMENT ON COLUMN "blade_tenant"."contact_number" IS '联系电话';
COMMENT ON COLUMN "blade_tenant"."address" IS '联系地址';
COMMENT ON COLUMN "blade_tenant"."account_number" IS '账号额度';
COMMENT ON COLUMN "blade_tenant"."expire_time" IS '过期时间';
COMMENT ON COLUMN "blade_tenant"."datasource_id" IS '数据源ID';
COMMENT ON COLUMN "blade_tenant"."license_key" IS '授权码';
COMMENT ON COLUMN "blade_tenant"."create_user" IS '创建人';
COMMENT ON COLUMN "blade_tenant"."create_dept" IS '创建部门';
@ -4698,7 +4700,7 @@ COMMENT ON TABLE "blade_tenant" IS '租户表';
-- Records of blade_tenant
-- ----------------------------
BEGIN;
INSERT INTO "blade_tenant" VALUES (1123598820738675201, '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', -1, NULL, NULL, 1123598821738675201, 1123598813738675201, '2019-01-01 00:00:39', 1123598821738675201, '2019-01-01 00:00:39', 1, 0);
INSERT INTO "blade_tenant" VALUES (1123598820738675201, '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', -1, NULL, NULL, NULL, 1123598821738675201, 1123598813738675201, '2019-01-01 00:00:39', 1123598821738675201, '2019-01-01 00:00:39', 1, 0);
COMMIT;
-- ----------------------------

4
doc/sql/postgresql/bladex-sword-postgresql.sql

@ -4662,6 +4662,7 @@ CREATE TABLE "blade_tenant" (
"address" varchar(255) COLLATE "pg_catalog"."default",
"account_number" int2 DEFAULT '-1'::integer,
"expire_time" timestamp(6),
"datasource_id" int8,
"license_key" varchar(1000) COLLATE "pg_catalog"."default",
"create_user" int8,
"create_dept" int8,
@ -4682,6 +4683,7 @@ COMMENT ON COLUMN "blade_tenant"."contact_number" IS '联系电话';
COMMENT ON COLUMN "blade_tenant"."address" IS '联系地址';
COMMENT ON COLUMN "blade_tenant"."account_number" IS '账号额度';
COMMENT ON COLUMN "blade_tenant"."expire_time" IS '过期时间';
COMMENT ON COLUMN "blade_tenant"."datasource_id" IS '数据源ID';
COMMENT ON COLUMN "blade_tenant"."license_key" IS '授权码';
COMMENT ON COLUMN "blade_tenant"."create_user" IS '创建人';
COMMENT ON COLUMN "blade_tenant"."create_dept" IS '创建部门';
@ -4696,7 +4698,7 @@ COMMENT ON TABLE "blade_tenant" IS '租户表';
-- Records of blade_tenant
-- ----------------------------
BEGIN;
INSERT INTO "blade_tenant" VALUES (1123598820738675201, '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', -1, NULL, NULL, 1123598821738675201, 1123598813738675201, '2019-01-01 00:00:39', 1123598821738675201, '2019-01-01 00:00:39', 1, 0);
INSERT INTO "blade_tenant" VALUES (1123598820738675201, '000000', '管理组', NULL, NULL, 'admin', '666666', '管理组', -1, NULL, NULL, NULL, 1123598821738675201, 1123598813738675201, '2019-01-01 00:00:39', 1123598821738675201, '2019-01-01 00:00:39', 1, 0);
COMMIT;
-- ----------------------------

10
doc/sql/sqlserver/bladex-saber-sqlserver.sql

@ -3187,6 +3187,7 @@ CREATE TABLE [dbo].[blade_tenant] (
[address] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
[account_number] int NULL,
[expire_time] datetime2(0) NULL,
[datasource_id] bigint NULL,
[license_key] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[create_user] bigint NULL,
[create_dept] bigint NULL,
@ -3271,6 +3272,13 @@ EXEC sp_addextendedproperty
'COLUMN', N'expire_time'
GO
EXEC sp_addextendedproperty
'MS_Description', N'数据源ID',
'SCHEMA', N'dbo',
'TABLE', N'blade_tenant',
'COLUMN', N'datasource_id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'授权码',
'SCHEMA', N'dbo',
@ -3340,7 +3348,7 @@ GO
BEGIN TRANSACTION
GO
INSERT INTO [dbo].[blade_tenant] VALUES (N'1123598820738675201', N'000000', N'管理组', NULL, NULL, N'admin', N'666666', N'管理组', N'-1', NULL, NULL, N'1123598821738675201', N'1123598813738675201', N'2019-01-01 00:00:39', N'1123598821738675201', N'2019-01-01 00:00:39', N'1', N'0')
INSERT INTO [dbo].[blade_tenant] VALUES (N'1123598820738675201', N'000000', N'管理组', NULL, NULL, N'admin', N'666666', N'管理组', N'-1', NULL, NULL, NULL, N'1123598821738675201', N'1123598813738675201', N'2019-01-01 00:00:39', N'1123598821738675201', N'2019-01-01 00:00:39', N'1', N'0')
GO
COMMIT

10
doc/sql/sqlserver/bladex-sword-sqlserver.sql

@ -3187,6 +3187,7 @@ CREATE TABLE [dbo].[blade_tenant] (
[address] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL,
[account_number] int NULL,
[expire_time] datetime2(0) NULL,
[datasource_id] bigint NULL,
[license_key] nvarchar(1000) COLLATE Chinese_PRC_CI_AS NULL,
[create_user] bigint NULL,
[create_dept] bigint NULL,
@ -3271,6 +3272,13 @@ EXEC sp_addextendedproperty
'COLUMN', N'expire_time'
GO
EXEC sp_addextendedproperty
'MS_Description', N'数据源ID',
'SCHEMA', N'dbo',
'TABLE', N'blade_tenant',
'COLUMN', N'datasource_id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'授权码',
'SCHEMA', N'dbo',
@ -3340,7 +3348,7 @@ GO
BEGIN TRANSACTION
GO
INSERT INTO [dbo].[blade_tenant] VALUES (N'1123598820738675201', N'000000', N'管理组', NULL, NULL, N'admin', N'666666', N'管理组', N'-1', NULL, NULL, N'1123598821738675201', N'1123598813738675201', N'2019-01-01 00:00:39', N'1123598821738675201', N'2019-01-01 00:00:39', N'1', N'0')
INSERT INTO [dbo].[blade_tenant] VALUES (N'1123598820738675201', N'000000', N'管理组', NULL, NULL, N'admin', N'666666', N'管理组', N'-1', NULL, NULL, NULL, N'1123598821738675201', N'1123598813738675201', N'2019-01-01 00:00:39', N'1123598821738675201', N'2019-01-01 00:00:39', N'1', N'0')
GO
COMMIT

6
doc/sql/update/mysql-update-2.5.1~2.5.2.sql

@ -4,6 +4,12 @@
ALTER TABLE `blade_user_oauth`
ADD COLUMN `uuid` varchar(64) NULL COMMENT '第三方系统用户ID' AFTER `tenant_id`;
-- ----------------------------
-- 租户数据源ID
-- ----------------------------
ALTER TABLE `blade_tenant`
ADD COLUMN `datasource_id` bigint(64) NULL COMMENT '数据源' AFTER `expire_time`;
-- ----------------------------
-- 附件表
-- ----------------------------

7
doc/sql/update/oracle-update-2.5.1~2.5.2.sql

@ -5,6 +5,13 @@ ALTER TABLE "BLADE_USER_OAUTH"
ADD ("UUID" VARCHAR2(64) );
COMMENT ON COLUMN "BLADE_USER_OAUTH"."UUID" IS '第三方系统用户ID';
-- ----------------------------
-- 租户数据源ID
-- ----------------------------
ALTER TABLE "BLADE_TENANT"
ADD ("DATASOURCE_ID" NUMBER(20) );
COMMENT ON COLUMN "BLADE_TENANT"."DATASOURCE_ID" IS '数据源ID'
-- ----------------------------
-- 附件表
-- ----------------------------

7
doc/sql/update/postgresql-update-2.5.1~2.5.2.sql

@ -5,6 +5,13 @@ ALTER TABLE "blade_user_oauth"
ADD COLUMN "uuid" varchar(64) COLLATE "pg_catalog"."default";
COMMENT ON COLUMN "blade_user_oauth"."uuid" IS '第三方系统用户ID';
-- ----------------------------
-- 租户数据源ID
-- ----------------------------
ALTER TABLE "blade_tenant"
ADD COLUMN "datasource_id" int8;
COMMENT ON COLUMN "blade_tenant"."datasource_id" IS '数据源ID';
-- ----------------------------
-- 附件表
-- ----------------------------

Loading…
Cancel
Save