🎉 2.4.0.RELEASE

This commit is contained in:
smallchill 2019-08-08 14:00:15 +08:00
parent de204e7744
commit c129a6ad4f
50 changed files with 124 additions and 113 deletions

View File

@ -62,11 +62,21 @@ SpringBlade
## 技术文档 ## 技术文档
* [SpringBlade开发手册](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册) * [SpringBlade开发手册](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册)
# 开源协议
Apache Licence 2.0 [英文原文](http://www.apache.org/licenses/LICENSE-2.0.html)
Apache Licence是著名的非盈利开源组织Apache采用的协议。该协议和BSD类似同样鼓励代码共享和尊重原作者的著作权同样允许代码修改再发布作为开源或商业软件
需要满足的条件如下:
* 需要给代码的用户一份Apache Licence
* 如果你修改了代码,需要在被修改的文件中说明。
* 在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明。
* 如果再发布的产品中包含一个Notice文件则在Notice文件中需要带有Apache Licence。你可以在Notice中增加自己的许可但不可以表现为对Apache Licence构成更改。
Apache Licence也是对商业应用友好的许可。使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售。
## 用户权益 ## 用户权益
* 允许免费用于学习、毕设、公司项目、私活等。 * 允许免费用于学习、毕设、公司项目、私活等。
* 代码文件需保留相关license信息。 * 对未经过授权和不遵循 Apache 2.0 协议二次开源或者商业化我们将追究到底
* 禁止直接将本项目挂淘宝等商业平台出售。 * 参考请注明:参考自 SpringBladehttps://gitee.com/smallc/SpringBlade 。另请遵循 Apache 2.0 协议
* 非界面代码50%以上相似度的二次开源,二次开源需先联系作者。 * `注意`:若禁止条款被发现有权追讨 **19999** 的授权费
# 界面 # 界面

View File

@ -8,7 +8,7 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<artifactId>blade-auth</artifactId> <artifactId>blade-auth</artifactId>

View File

@ -43,17 +43,17 @@ import org.springframework.web.bind.annotation.RestController;
public class AuthController { public class AuthController {
@PostMapping("token") @PostMapping("token")
@ApiOperation(value = "获取认证token", notes = "传入租户编号:tenantCode,账号:account,密码:password") @ApiOperation(value = "获取认证token", notes = "传入租户ID:tenantId,账号:account,密码:password")
public R<AuthInfo> token(@ApiParam(value = "授权类型", required = true) @RequestParam(defaultValue = "password", required = false) String grantType, public R<AuthInfo> token(@ApiParam(value = "授权类型", required = true) @RequestParam(defaultValue = "password", required = false) String grantType,
@ApiParam(value = "刷新令牌") @RequestParam(required = false) String refreshToken, @ApiParam(value = "刷新令牌") @RequestParam(required = false) String refreshToken,
@ApiParam(value = "租户编号", required = true) @RequestParam(defaultValue = "000000", required = false) String tenantCode, @ApiParam(value = "租户ID", required = true) @RequestParam(defaultValue = "000000", required = false) String tenantId,
@ApiParam(value = "账号") @RequestParam(required = false) String account, @ApiParam(value = "账号") @RequestParam(required = false) String account,
@ApiParam(value = "密码") @RequestParam(required = false) String password) { @ApiParam(value = "密码") @RequestParam(required = false) String password) {
String userType = Func.toStr(WebUtil.getRequest().getHeader(TokenUtil.USER_TYPE_HEADER_KEY), TokenUtil.DEFAULT_USER_TYPE); String userType = Func.toStr(WebUtil.getRequest().getHeader(TokenUtil.USER_TYPE_HEADER_KEY), TokenUtil.DEFAULT_USER_TYPE);
TokenParameter tokenParameter = new TokenParameter(); TokenParameter tokenParameter = new TokenParameter();
tokenParameter.getArgs().set("tenantCode", tenantCode).set("account", account).set("password", password).set("grantType", grantType).set("refreshToken", refreshToken).set("userType", userType); tokenParameter.getArgs().set("tenantId", tenantId).set("account", account).set("password", password).set("grantType", grantType).set("refreshToken", refreshToken).set("userType", userType);
ITokenGranter granter = TokenGranterBuilder.getGranter(grantType); ITokenGranter granter = TokenGranterBuilder.getGranter(grantType);
UserInfo userInfo = granter.grant(tokenParameter); UserInfo userInfo = granter.grant(tokenParameter);

View File

@ -39,7 +39,7 @@ public class PasswordTokenGranter implements ITokenGranter {
@Override @Override
public UserInfo grant(TokenParameter tokenParameter) { public UserInfo grant(TokenParameter tokenParameter) {
String tenantCode = tokenParameter.getArgs().getStr("tenantCode"); String tenantId = tokenParameter.getArgs().getStr("tenantId");
String account = tokenParameter.getArgs().getStr("account"); String account = tokenParameter.getArgs().getStr("account");
String password = tokenParameter.getArgs().getStr("password"); String password = tokenParameter.getArgs().getStr("password");
UserInfo userInfo = null; UserInfo userInfo = null;
@ -49,11 +49,11 @@ public class PasswordTokenGranter implements ITokenGranter {
R<UserInfo> result; R<UserInfo> result;
// 根据不同用户类型调用对应的接口返回数据用户可自行拓展 // 根据不同用户类型调用对应的接口返回数据用户可自行拓展
if (userType.equals(BladeUserEnum.WEB.getName())) { if (userType.equals(BladeUserEnum.WEB.getName())) {
result = userClient.userInfo(tenantCode, account, DigestUtil.encrypt(password)); result = userClient.userInfo(tenantId, account, DigestUtil.encrypt(password));
} else if (userType.equals(BladeUserEnum.APP.getName())) { } else if (userType.equals(BladeUserEnum.APP.getName())) {
result = userClient.userInfo(tenantCode, account, DigestUtil.encrypt(password)); result = userClient.userInfo(tenantId, account, DigestUtil.encrypt(password));
} else { } else {
result = userClient.userInfo(tenantCode, account, DigestUtil.encrypt(password)); result = userClient.userInfo(tenantId, account, DigestUtil.encrypt(password));
} }
userInfo = result.isSuccess() ? result.getData() : null; userInfo = result.isSuccess() ? result.getData() : null;
} }

View File

@ -33,7 +33,7 @@ import java.util.Map;
*/ */
public class TokenUtil { public class TokenUtil {
public final static String TENANT_HEADER_KEY = "Tenant-Code"; public final static String TENANT_HEADER_KEY = "Tenant-Id";
public final static String DEFAULT_TENANT_ID = "000000"; public final static String DEFAULT_TENANT_ID = "000000";
public final static String USER_TYPE_HEADER_KEY = "User-Type"; public final static String USER_TYPE_HEADER_KEY = "User-Type";
public final static String DEFAULT_USER_TYPE = "web"; public final static String DEFAULT_USER_TYPE = "web";
@ -54,7 +54,7 @@ public class TokenUtil {
//设置jwt参数 //设置jwt参数
Map<String, String> param = new HashMap<>(16); Map<String, String> param = new HashMap<>(16);
param.put(TokenConstant.TOKEN_TYPE, TokenConstant.ACCESS_TOKEN); param.put(TokenConstant.TOKEN_TYPE, TokenConstant.ACCESS_TOKEN);
param.put(TokenConstant.TENANT_CODE, user.getTenantCode()); param.put(TokenConstant.TENANT_ID, user.getTenantId());
param.put(TokenConstant.USER_ID, Func.toStr(user.getId())); param.put(TokenConstant.USER_ID, Func.toStr(user.getId()));
param.put(TokenConstant.ROLE_ID, user.getRoleId()); param.put(TokenConstant.ROLE_ID, user.getRoleId());
param.put(TokenConstant.ACCOUNT, user.getAccount()); param.put(TokenConstant.ACCOUNT, user.getAccount());

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
@ -66,13 +66,14 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- Nacos -->
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>${alibaba.cloud.version}</version> <version>${alibaba.cloud.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>${alibaba.cloud.version}</version> <version>${alibaba.cloud.version}</version>
</dependency> </dependency>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-ops</artifactId> <artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-ops</artifactId> <artifactId>blade-ops</artifactId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-ops</artifactId> <artifactId>blade-ops</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -45,10 +45,10 @@ public class Dept implements Serializable {
private Integer id; private Integer id;
/** /**
* 租户编号 * 租户ID
*/ */
@ApiModelProperty(value = "租户编号") @ApiModelProperty(value = "租户ID")
private String tenantCode; private String tenantId;
/** /**
* 父主键 * 父主键

View File

@ -45,10 +45,10 @@ public class Role implements Serializable {
private Integer id; private Integer id;
/** /**
* 租户编号 * 租户ID
*/ */
@ApiModelProperty(value = "租户编号") @ApiModelProperty(value = "租户ID")
private String tenantCode; private String tenantId;
/** /**
* 父主键 * 父主键

View File

@ -45,10 +45,10 @@ public class Tenant extends BaseEntity {
private Integer id; private Integer id;
/** /**
* 租户编号 * 租户ID
*/ */
@ApiModelProperty(value = "租户编号") @ApiModelProperty(value = "租户ID")
private String tenantCode; private String tenantId;
/** /**
* 租户名称 * 租户名称
*/ */

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -48,12 +48,12 @@ public interface IUserClient {
/** /**
* 获取用户信息 * 获取用户信息
* *
* @param tenantCode 租户编号 * @param tenantId 租户ID
* @param account 账号 * @param account 账号
* @param password 密码 * @param password 密码
* @return * @return
*/ */
@GetMapping(API_PREFIX + "/user-info") @GetMapping(API_PREFIX + "/user-info")
R<UserInfo> userInfo(@RequestParam("tenantCode") String tenantCode, @RequestParam("account") String account, @RequestParam("password") String password); R<UserInfo> userInfo(@RequestParam("tenantId") String tenantId, @RequestParam("account") String account, @RequestParam("password") String password);
} }

View File

@ -33,7 +33,7 @@ public class IUserClientFallback implements IUserClient {
} }
@Override @Override
public R<UserInfo> userInfo(String tenantCode, String account, String password) { public R<UserInfo> userInfo(String tenantId, String account, String password) {
return R.fail("未获取到账号信息"); return R.fail("未获取到账号信息");
} }
} }

View File

@ -5,13 +5,13 @@
<parent> <parent>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>blade-service-api</artifactId> <artifactId>blade-service-api</artifactId>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
<version>2.3.3</version> <version>2.4.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>SpringBlade 微服务API集合</description> <description>SpringBlade 微服务API集合</description>

View File

@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -72,7 +72,7 @@ public class DeptController extends BladeController {
@ApiOperation(value = "列表", notes = "传入dept") @ApiOperation(value = "列表", notes = "传入dept")
public R<List<INode>> list(@ApiIgnore @RequestParam Map<String, Object> dept, BladeUser bladeUser) { public R<List<INode>> list(@ApiIgnore @RequestParam Map<String, Object> dept, BladeUser bladeUser) {
QueryWrapper<Dept> queryWrapper = Condition.getQueryWrapper(dept, Dept.class); QueryWrapper<Dept> queryWrapper = Condition.getQueryWrapper(dept, Dept.class);
List<Dept> list = deptService.list((!bladeUser.getTenantCode().equals(BladeConstant.ADMIN_TENANT_CODE)) ? queryWrapper.lambda().eq(Dept::getTenantCode, bladeUser.getTenantCode()) : queryWrapper); List<Dept> list = deptService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Dept::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(DeptWrapper.build().listNodeVO(list)); return R.data(DeptWrapper.build().listNodeVO(list));
} }
@ -84,8 +84,8 @@ public class DeptController extends BladeController {
@GetMapping("/tree") @GetMapping("/tree")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "树形结构", notes = "树形结构") @ApiOperation(value = "树形结构", notes = "树形结构")
public R<List<DeptVO>> tree(String tenantCode, BladeUser bladeUser) { public R<List<DeptVO>> tree(String tenantId, BladeUser bladeUser) {
List<DeptVO> tree = deptService.tree(Func.toStr(tenantCode, bladeUser.getTenantCode())); List<DeptVO> tree = deptService.tree(Func.toStr(tenantId, bladeUser.getTenantId()));
return R.data(tree); return R.data(tree);
} }
@ -97,7 +97,7 @@ public class DeptController extends BladeController {
@ApiOperation(value = "新增或修改", notes = "传入dept") @ApiOperation(value = "新增或修改", notes = "传入dept")
public R submit(@Valid @RequestBody Dept dept, BladeUser user) { public R submit(@Valid @RequestBody Dept dept, BladeUser user) {
if (Func.isEmpty(dept.getId())) { if (Func.isEmpty(dept.getId())) {
dept.setTenantCode(user.getTenantCode()); dept.setTenantId(user.getTenantId());
} }
return R.status(deptService.saveOrUpdate(dept)); return R.status(deptService.saveOrUpdate(dept));
} }

View File

@ -72,7 +72,7 @@ public class RoleController extends BladeController {
@ApiOperation(value = "列表", notes = "传入role") @ApiOperation(value = "列表", notes = "传入role")
public R<List<INode>> list(@ApiIgnore @RequestParam Map<String, Object> role, BladeUser bladeUser) { public R<List<INode>> list(@ApiIgnore @RequestParam Map<String, Object> role, BladeUser bladeUser) {
QueryWrapper<Role> queryWrapper = Condition.getQueryWrapper(role, Role.class); QueryWrapper<Role> queryWrapper = Condition.getQueryWrapper(role, Role.class);
List<Role> list = roleService.list((!bladeUser.getTenantCode().equals(BladeConstant.ADMIN_TENANT_CODE)) ? queryWrapper.lambda().eq(Role::getTenantCode, bladeUser.getTenantCode()) : queryWrapper); List<Role> list = roleService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Role::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(RoleWrapper.build().listNodeVO(list)); return R.data(RoleWrapper.build().listNodeVO(list));
} }
@ -82,8 +82,8 @@ public class RoleController extends BladeController {
@GetMapping("/tree") @GetMapping("/tree")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@ApiOperation(value = "树形结构", notes = "树形结构") @ApiOperation(value = "树形结构", notes = "树形结构")
public R<List<RoleVO>> tree(String tenantCode, BladeUser bladeUser) { public R<List<RoleVO>> tree(String tenantId, BladeUser bladeUser) {
List<RoleVO> tree = roleService.tree(Func.toStr(tenantCode, bladeUser.getTenantCode())); List<RoleVO> tree = roleService.tree(Func.toStr(tenantId, bladeUser.getTenantId()));
return R.data(tree); return R.data(tree);
} }
@ -95,7 +95,7 @@ public class RoleController extends BladeController {
@ApiOperation(value = "新增或修改", notes = "传入role") @ApiOperation(value = "新增或修改", notes = "传入role")
public R submit(@Valid @RequestBody Role role, BladeUser user) { public R submit(@Valid @RequestBody Role role, BladeUser user) {
if (Func.isEmpty(role.getId())) { if (Func.isEmpty(role.getId())) {
role.setTenantCode(user.getTenantCode()); role.setTenantId(user.getTenantId());
} }
return R.status(roleService.saveOrUpdate(role)); return R.status(roleService.saveOrUpdate(role));
} }

View File

@ -64,14 +64,14 @@ public class TenantController extends BladeController {
*/ */
@GetMapping("/list") @GetMapping("/list")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "tenantCode", value = "参数名称", paramType = "query", dataType = "string"), @ApiImplicitParam(name = "tenantId", value = "参数名称", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "tenantName", value = "角色别名", paramType = "query", dataType = "string"), @ApiImplicitParam(name = "tenantName", value = "角色别名", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "contactNumber", value = "联系电话", paramType = "query", dataType = "string") @ApiImplicitParam(name = "contactNumber", value = "联系电话", paramType = "query", dataType = "string")
}) })
@ApiOperation(value = "分页", notes = "传入tenant") @ApiOperation(value = "分页", notes = "传入tenant")
public R<IPage<Tenant>> list(@ApiIgnore @RequestParam Map<String, Object> tenant, Query query, BladeUser bladeUser) { public R<IPage<Tenant>> list(@ApiIgnore @RequestParam Map<String, Object> tenant, Query query, BladeUser bladeUser) {
QueryWrapper<Tenant> queryWrapper = Condition.getQueryWrapper(tenant, Tenant.class); QueryWrapper<Tenant> queryWrapper = Condition.getQueryWrapper(tenant, Tenant.class);
IPage<Tenant> pages = tenantService.page(Condition.getPage(query), (!bladeUser.getTenantCode().equals(BladeConstant.ADMIN_TENANT_CODE)) ? queryWrapper.lambda().eq(Tenant::getTenantCode, bladeUser.getTenantCode()) : queryWrapper); IPage<Tenant> pages = tenantService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(pages); return R.data(pages);
} }
@ -82,7 +82,7 @@ public class TenantController extends BladeController {
@ApiOperation(value = "下拉数据源", notes = "传入tenant") @ApiOperation(value = "下拉数据源", notes = "传入tenant")
public R<List<Tenant>> select(Tenant tenant, BladeUser bladeUser) { public R<List<Tenant>> select(Tenant tenant, BladeUser bladeUser) {
QueryWrapper<Tenant> queryWrapper = Condition.getQueryWrapper(tenant); QueryWrapper<Tenant> queryWrapper = Condition.getQueryWrapper(tenant);
List<Tenant> list = tenantService.list((!bladeUser.getTenantCode().equals(BladeConstant.ADMIN_TENANT_CODE)) ? queryWrapper.lambda().eq(Tenant::getTenantCode, bladeUser.getTenantCode()) : queryWrapper); List<Tenant> list = tenantService.list((!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(Tenant::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(list); return R.data(list);
} }

View File

@ -41,9 +41,9 @@ public interface DeptMapper extends BaseMapper<Dept> {
/** /**
* 获取树形节点 * 获取树形节点
* *
* @param tenantCode * @param tenantId
* @return * @return
*/ */
List<DeptVO> tree(String tenantCode); List<DeptVO> tree(String tenantId);
} }

View File

@ -34,7 +34,7 @@
<select id="tree" resultMap="treeNodeResultMap"> <select id="tree" resultMap="treeNodeResultMap">
select id, parent_id, dept_name as title, id as 'value', id as 'key' from blade_dept where is_deleted = 0 select id, parent_id, dept_name as title, id as 'value', id as 'key' from blade_dept where is_deleted = 0
<if test="_parameter!=null"> <if test="_parameter!=null">
and tenant_code = #{_parameter} and tenant_id = #{_parameter}
</if> </if>
</select> </select>

View File

@ -41,10 +41,10 @@ public interface RoleMapper extends BaseMapper<Role> {
/** /**
* 获取树形节点 * 获取树形节点
* *
* @param tenantCode * @param tenantId
* @param excludeRole * @param excludeRole
* @return * @return
*/ */
List<RoleVO> tree(String tenantCode, String excludeRole); List<RoleVO> tree(String tenantId, String excludeRole);
} }

View File

@ -33,7 +33,7 @@
<select id="tree" resultMap="treeNodeResultMap"> <select id="tree" resultMap="treeNodeResultMap">
select id, parent_id, role_name as title, id as 'value', id as 'key' from blade_role where is_deleted = 0 select id, parent_id, role_name as title, id as 'value', id as 'key' from blade_role where is_deleted = 0
<if test="param1!=null"> <if test="param1!=null">
and tenant_code = #{param1} and tenant_id = #{param1}
</if> </if>
<if test="param2!=null"> <if test="param2!=null">
and role_alias &lt;&gt; #{param2} and role_alias &lt;&gt; #{param2}

View File

@ -41,9 +41,9 @@ public interface IDeptService extends IService<Dept> {
/** /**
* 树形结构 * 树形结构
* *
* @param tenantCode * @param tenantId
* @return * @return
*/ */
List<DeptVO> tree(String tenantCode); List<DeptVO> tree(String tenantId);
} }

View File

@ -42,10 +42,10 @@ public interface IRoleService extends IService<Role> {
/** /**
* 树形结构 * 树形结构
* *
* @param tenantCode * @param tenantId
* @return * @return
*/ */
List<RoleVO> tree(String tenantCode); List<RoleVO> tree(String tenantId);
/** /**
* 权限配置 * 权限配置

View File

@ -40,8 +40,8 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements ID
} }
@Override @Override
public List<DeptVO> tree(String tenantCode) { public List<DeptVO> tree(String tenantId) {
return ForestNodeMerger.merge(baseMapper.tree(tenantCode)); return ForestNodeMerger.merge(baseMapper.tree(tenantId));
} }
} }

View File

@ -87,7 +87,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IM
@Override @Override
public List<MenuVO> grantTree(BladeUser user) { public List<MenuVO> grantTree(BladeUser user) {
return ForestNodeMerger.merge(user.getTenantCode().equals(BladeConstant.ADMIN_TENANT_CODE) ? baseMapper.grantTree() : baseMapper.grantTreeByRole(Func.toIntList(user.getRoleId()))); return ForestNodeMerger.merge(user.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? baseMapper.grantTree() : baseMapper.grantTreeByRole(Func.toIntList(user.getRoleId())));
} }
@Override @Override

View File

@ -55,13 +55,13 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
} }
@Override @Override
public List<RoleVO> tree(String tenantCode) { public List<RoleVO> tree(String tenantId) {
String userRole = SecureUtil.getUserRole(); String userRole = SecureUtil.getUserRole();
String excludeRole = null; String excludeRole = null;
if (!CollectionUtil.contains(Func.toStrArray(userRole), RoleConstant.ADMIN)) { if (!CollectionUtil.contains(Func.toStrArray(userRole), RoleConstant.ADMIN)) {
excludeRole = RoleConstant.ADMIN; excludeRole = RoleConstant.ADMIN;
} }
return ForestNodeMerger.merge(baseMapper.tree(tenantCode, excludeRole)); return ForestNodeMerger.merge(baseMapper.tree(tenantId, excludeRole));
} }
@Override @Override

View File

@ -58,12 +58,12 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
public boolean saveTenant(Tenant tenant) { public boolean saveTenant(Tenant tenant) {
if (Func.isEmpty(tenant.getId())) { if (Func.isEmpty(tenant.getId())) {
List<Tenant> tenants = baseMapper.selectList(Wrappers.<Tenant>query().lambda().eq(Tenant::getIsDeleted, BladeConstant.DB_NOT_DELETED)); List<Tenant> tenants = baseMapper.selectList(Wrappers.<Tenant>query().lambda().eq(Tenant::getIsDeleted, BladeConstant.DB_NOT_DELETED));
List<String> codes = tenants.stream().map(Tenant::getTenantCode).collect(Collectors.toList()); List<String> codes = tenants.stream().map(Tenant::getTenantId).collect(Collectors.toList());
String tenantCode = getTenantCode(codes); String tenantId = getTenantId(codes);
tenant.setTenantCode(tenantCode); tenant.setTenantId(tenantId);
// 新建租户对应的默认角色 // 新建租户对应的默认角色
Role role = new Role(); Role role = new Role();
role.setTenantCode(tenantCode); role.setTenantId(tenantId);
role.setParentId(0); role.setParentId(0);
role.setRoleName("管理员"); role.setRoleName("管理员");
role.setRoleAlias("admin"); role.setRoleAlias("admin");
@ -72,7 +72,7 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
roleMapper.insert(role); roleMapper.insert(role);
// 新建租户对应的默认部门 // 新建租户对应的默认部门
Dept dept = new Dept(); Dept dept = new Dept();
dept.setTenantCode(tenantCode); dept.setTenantId(tenantId);
dept.setParentId(0); dept.setParentId(0);
dept.setDeptName(tenant.getTenantName()); dept.setDeptName(tenant.getTenantName());
dept.setFullName(tenant.getTenantName()); dept.setFullName(tenant.getTenantName());
@ -83,10 +83,10 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
return super.saveOrUpdate(tenant); return super.saveOrUpdate(tenant);
} }
private String getTenantCode(List<String> codes) { private String getTenantId(List<String> codes) {
String code = tenantId.generate(); String code = tenantId.generate();
if (codes.contains(code)) { if (codes.contains(code)) {
return getTenantCode(codes); return getTenantId(codes);
} }
return code; return code;
} }

View File

@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -71,7 +71,7 @@ public class UserController {
@ApiOperation(value = "列表", notes = "传入account和realName") @ApiOperation(value = "列表", notes = "传入account和realName")
public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) { public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) {
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class); QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
IPage<User> pages = userService.page(Condition.getPage(query), (!bladeUser.getTenantCode().equals(BladeConstant.ADMIN_TENANT_CODE)) ? queryWrapper.lambda().eq(User::getTenantCode, bladeUser.getTenantCode()) : queryWrapper); IPage<User> pages = userService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()) : queryWrapper);
return R.data(UserWrapper.build().pageVO(pages)); return R.data(UserWrapper.build().pageVO(pages));
} }

View File

@ -41,8 +41,8 @@ public class UserClient implements IUserClient {
@Override @Override
@GetMapping(API_PREFIX + "/user-info") @GetMapping(API_PREFIX + "/user-info")
public R<UserInfo> userInfo(String tenantCode, String account, String password) { public R<UserInfo> userInfo(String tenantId, String account, String password) {
return R.data(service.userInfo(tenantCode, account, password)); return R.data(service.userInfo(tenantId, account, password));
} }
} }

View File

@ -40,12 +40,12 @@ public interface UserMapper extends BaseMapper<User> {
/** /**
* 获取用户 * 获取用户
* *
* @param tenantCode * @param tenantId
* @param account * @param account
* @param password * @param password
* @return * @return
*/ */
User getUser(String tenantCode, String account, String password); User getUser(String tenantId, String account, String password);
/** /**
* 获取角色名 * 获取角色名

View File

@ -5,7 +5,7 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="userResultMap" type="org.springblade.system.user.entity.User"> <resultMap id="userResultMap" type="org.springblade.system.user.entity.User">
<result column="id" property="id"/> <result column="id" property="id"/>
<result column="tenant_code" property="tenantCode"/> <result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/> <result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/> <result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/> <result column="update_user" property="updateUser"/>
@ -46,7 +46,7 @@
FROM FROM
blade_user blade_user
WHERE WHERE
tenant_code = #{param1} and account = #{param2} and password = #{param3} and is_deleted = 0 tenant_id = #{param1} and account = #{param2} and password = #{param3} and is_deleted = 0
</select> </select>
<select id="getRoleName" resultType="java.lang.String"> <select id="getRoleName" resultType="java.lang.String">

View File

@ -58,12 +58,12 @@ public interface IUserService extends BaseService<User> {
/** /**
* 用户信息 * 用户信息
* *
* @param tenantCode * @param tenantId
* @param account * @param account
* @param password * @param password
* @return * @return
*/ */
UserInfo userInfo(String tenantCode, String account, String password); UserInfo userInfo(String tenantId, String account, String password);
/** /**
* 给用户设置角色 * 给用户设置角色

View File

@ -45,7 +45,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
if (Func.isNotEmpty(user.getPassword())) { if (Func.isNotEmpty(user.getPassword())) {
user.setPassword(DigestUtil.encrypt(user.getPassword())); user.setPassword(DigestUtil.encrypt(user.getPassword()));
} }
Integer cnt = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantCode, user.getTenantCode()).eq(User::getAccount, user.getAccount())); Integer cnt = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, user.getTenantId()).eq(User::getAccount, user.getAccount()));
if (cnt > 0) { if (cnt > 0) {
throw new ApiException("当前用户已存在!"); throw new ApiException("当前用户已存在!");
} }
@ -70,9 +70,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
} }
@Override @Override
public UserInfo userInfo(String tenantCode, String account, String password) { public UserInfo userInfo(String tenantId, String account, String password) {
UserInfo userInfo = new UserInfo(); UserInfo userInfo = new UserInfo();
User user = baseMapper.getUser(tenantCode, account, password); User user = baseMapper.getUser(tenantId, account, password);
userInfo.setUser(user); userInfo.setUser(user);
if (Func.isNotEmpty(user)) { if (Func.isNotEmpty(user)) {
List<String> roleAlias = baseMapper.getRoleAlias(Func.toStrArray(user.getRoleId())); List<String> roleAlias = baseMapper.getRoleAlias(Func.toStrArray(user.getRoleId()));

View File

@ -7,12 +7,12 @@
<parent> <parent>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<version>2.3.3</version> <version>2.4.0</version>
</parent> </parent>
<artifactId>blade-service</artifactId> <artifactId>blade-service</artifactId>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
<version>2.3.3</version> <version>2.4.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>SpringBlade 微服务集合</description> <description>SpringBlade 微服务集合</description>

View File

@ -84,7 +84,7 @@ blade:
path-patterns: path-patterns:
- /saber/** - /saber/**
tenant: tenant:
column: tenant_code column: tenant_id
tables: tables:
- blade_notice - blade_notice

View File

@ -81,7 +81,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_dept`; DROP TABLE IF EXISTS `blade_dept`;
CREATE TABLE `blade_dept` ( CREATE TABLE `blade_dept` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`parent_id` int(11) NULL DEFAULT 0 COMMENT '父主键', `parent_id` int(11) NULL DEFAULT 0 COMMENT '父主键',
`dept_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门名', `dept_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门名',
`full_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门全称', `full_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门全称',
@ -127,7 +127,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_log_api`; DROP TABLE IF EXISTS `blade_log_api`;
CREATE TABLE `blade_log_api` ( CREATE TABLE `blade_log_api` (
`id` bigint(64) NOT NULL COMMENT '编号', `id` bigint(64) NOT NULL COMMENT '编号',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID', `service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID',
`server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名', `server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名',
`server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址', `server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址',
@ -153,7 +153,7 @@ CREATE TABLE `blade_log_api` (
DROP TABLE IF EXISTS `blade_log_error`; DROP TABLE IF EXISTS `blade_log_error`;
CREATE TABLE `blade_log_error` ( CREATE TABLE `blade_log_error` (
`id` bigint(64) NOT NULL COMMENT '编号', `id` bigint(64) NOT NULL COMMENT '编号',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID', `service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID',
`server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名', `server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名',
`server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址', `server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址',
@ -182,7 +182,7 @@ CREATE TABLE `blade_log_error` (
DROP TABLE IF EXISTS `blade_log_usual`; DROP TABLE IF EXISTS `blade_log_usual`;
CREATE TABLE `blade_log_usual` ( CREATE TABLE `blade_log_usual` (
`id` bigint(64) NOT NULL COMMENT '编号', `id` bigint(64) NOT NULL COMMENT '编号',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID', `service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID',
`server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名', `server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名',
`server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址', `server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址',
@ -237,7 +237,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_notice`; DROP TABLE IF EXISTS `blade_notice`;
CREATE TABLE `blade_notice` ( CREATE TABLE `blade_notice` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题', `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
`category` int(11) NULL DEFAULT NULL COMMENT '类型', `category` int(11) NULL DEFAULT NULL COMMENT '类型',
`release_time` datetime(0) NULL DEFAULT NULL COMMENT '发布时间', `release_time` datetime(0) NULL DEFAULT NULL COMMENT '发布时间',
@ -290,7 +290,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_role`; DROP TABLE IF EXISTS `blade_role`;
CREATE TABLE `blade_role` ( CREATE TABLE `blade_role` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`parent_id` int(11) NULL DEFAULT 0 COMMENT '父主键', `parent_id` int(11) NULL DEFAULT 0 COMMENT '父主键',
`role_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名', `role_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名',
`sort` int(11) NULL DEFAULT NULL COMMENT '排序', `sort` int(11) NULL DEFAULT NULL COMMENT '排序',
@ -330,7 +330,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_tenant`; DROP TABLE IF EXISTS `blade_tenant`;
CREATE TABLE `blade_tenant` ( CREATE TABLE `blade_tenant` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户ID',
`tenant_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户名称', `tenant_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户名称',
`linkman` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', `linkman` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人',
`contact_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', `contact_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话',
@ -357,7 +357,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_user`; DROP TABLE IF EXISTS `blade_user`;
CREATE TABLE `blade_user` ( CREATE TABLE `blade_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`account` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账号', `account` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账号',
`password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', `password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称', `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称',

View File

@ -81,7 +81,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_dept`; DROP TABLE IF EXISTS `blade_dept`;
CREATE TABLE `blade_dept` ( CREATE TABLE `blade_dept` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`parent_id` int(11) NULL DEFAULT 0 COMMENT '父主键', `parent_id` int(11) NULL DEFAULT 0 COMMENT '父主键',
`dept_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门名', `dept_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门名',
`full_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门全称', `full_name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门全称',
@ -127,7 +127,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_log_api`; DROP TABLE IF EXISTS `blade_log_api`;
CREATE TABLE `blade_log_api` ( CREATE TABLE `blade_log_api` (
`id` bigint(64) NOT NULL COMMENT '编号', `id` bigint(64) NOT NULL COMMENT '编号',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID', `service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID',
`server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名', `server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名',
`server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址', `server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址',
@ -153,7 +153,7 @@ CREATE TABLE `blade_log_api` (
DROP TABLE IF EXISTS `blade_log_error`; DROP TABLE IF EXISTS `blade_log_error`;
CREATE TABLE `blade_log_error` ( CREATE TABLE `blade_log_error` (
`id` bigint(64) NOT NULL COMMENT '编号', `id` bigint(64) NOT NULL COMMENT '编号',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID', `service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID',
`server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名', `server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名',
`server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址', `server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址',
@ -182,7 +182,7 @@ CREATE TABLE `blade_log_error` (
DROP TABLE IF EXISTS `blade_log_usual`; DROP TABLE IF EXISTS `blade_log_usual`;
CREATE TABLE `blade_log_usual` ( CREATE TABLE `blade_log_usual` (
`id` bigint(64) NOT NULL COMMENT '编号', `id` bigint(64) NOT NULL COMMENT '编号',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID', `service_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务ID',
`server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名', `server_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器名',
`server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址', `server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '服务器IP地址',
@ -237,7 +237,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_notice`; DROP TABLE IF EXISTS `blade_notice`;
CREATE TABLE `blade_notice` ( CREATE TABLE `blade_notice` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题', `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
`category` int(11) NULL DEFAULT NULL COMMENT '类型', `category` int(11) NULL DEFAULT NULL COMMENT '类型',
`release_time` datetime(0) NULL DEFAULT NULL COMMENT '发布时间', `release_time` datetime(0) NULL DEFAULT NULL COMMENT '发布时间',
@ -290,7 +290,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_role`; DROP TABLE IF EXISTS `blade_role`;
CREATE TABLE `blade_role` ( CREATE TABLE `blade_role` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`parent_id` int(11) NULL DEFAULT 0 COMMENT '父主键', `parent_id` int(11) NULL DEFAULT 0 COMMENT '父主键',
`role_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名', `role_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '角色名',
`sort` int(11) NULL DEFAULT NULL COMMENT '排序', `sort` int(11) NULL DEFAULT NULL COMMENT '排序',
@ -330,7 +330,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_tenant`; DROP TABLE IF EXISTS `blade_tenant`;
CREATE TABLE `blade_tenant` ( CREATE TABLE `blade_tenant` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户ID',
`tenant_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户名称', `tenant_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '租户名称',
`linkman` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人', `linkman` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人',
`contact_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话', `contact_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系电话',
@ -357,7 +357,7 @@ COMMIT;
DROP TABLE IF EXISTS `blade_user`; DROP TABLE IF EXISTS `blade_user`;
CREATE TABLE `blade_user` ( CREATE TABLE `blade_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`tenant_code` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户编号', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`account` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账号', `account` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账号',
`password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码', `password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称', `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称',

10
pom.xml
View File

@ -5,22 +5,22 @@
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>SpringBlade</artifactId> <artifactId>SpringBlade</artifactId>
<version>2.3.3</version> <version>2.4.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<blade.tool.version>2.3.3</blade.tool.version> <blade.tool.version>2.4.0</blade.tool.version>
<blade.project.version>2.3.3</blade.project.version> <blade.project.version>2.4.0</blade.project.version>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<swagger.version>2.9.2</swagger.version> <swagger.version>2.9.2</swagger.version>
<swagger.models.version>1.5.21</swagger.models.version> <swagger.models.version>1.5.21</swagger.models.version>
<swagger.bootstrapui.version>1.9.4</swagger.bootstrapui.version> <swagger.bootstrapui.version>1.9.5</swagger.bootstrapui.version>
<mybatis.plus.version>3.1.2</mybatis.plus.version> <mybatis.plus.version>3.1.2</mybatis.plus.version>
<curator.framework.version>4.0.1</curator.framework.version> <curator.framework.version>4.0.1</curator.framework.version>
<protostuff.version>1.6.0</protostuff.version> <protostuff.version>1.6.0</protostuff.version>
<mica.auto.version>1.1.0</mica.auto.version> <mica.auto.version>1.1.0</mica.auto.version>
<alibaba.cloud.version>0.9.0.RELEASE</alibaba.cloud.version> <alibaba.cloud.version>2.1.0.RELEASE</alibaba.cloud.version>
<spring.boot.admin.version>2.1.5</spring.boot.admin.version> <spring.boot.admin.version>2.1.5</spring.boot.admin.version>
<spring.boot.version>2.1.6.RELEASE</spring.boot.version> <spring.boot.version>2.1.6.RELEASE</spring.boot.version>

View File

@ -1,2 +1,2 @@
REGISTER=192.168.0.157/blade REGISTER=192.168.0.157/blade
TAG=2.3.3 TAG=2.4.0