mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-12-12 12:19:27 +08:00
🎉 2.7.0.RELEASE,内核全面升级,增加岗位管理,用户导入导出
This commit is contained in:
parent
1e30d8b839
commit
f7fa46462d
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -77,7 +77,7 @@ mybatis-plus:
|
||||
banner: false
|
||||
db-config:
|
||||
#主键类型 0:"数据库ID自增", 1:"不操作", 2:"用户输入ID",3:"数字型snowflake", 4:"全局唯一ID UUID", 5:"字符串型snowflake";
|
||||
id-type: auto
|
||||
id-type: assign_id
|
||||
#字段策略
|
||||
insert-strategy: not_null
|
||||
update-strategy: not_null
|
||||
@ -97,7 +97,7 @@ mybatis-plus:
|
||||
swagger:
|
||||
title: SpringBlade 接口文档系统
|
||||
description: SpringBlade 接口文档系统
|
||||
version: 2.6.2
|
||||
version: 2.7.0
|
||||
license: Powered By SpringBlade
|
||||
licenseUrl: https://bladex.vip
|
||||
terms-of-service-url: https://bladex.vip
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -160,7 +160,7 @@ public class $!{table.controllerName} {
|
||||
@ApiOperationSupport(order = 7)
|
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status($!{table.entityPath}Service.deleteLogic(Func.toIntList(ids)));
|
||||
return R.status($!{table.entityPath}Service.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
#else
|
||||
@ -172,7 +172,7 @@ public class $!{table.controllerName} {
|
||||
@ApiOperationSupport(order = 8)
|
||||
@ApiOperation(value = "删除", notes = "传入ids")
|
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status($!{table.entityPath}Service.removeByIds(Func.toIntList(ids)));
|
||||
return R.status($!{table.entityPath}Service.removeByIds(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
#end
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -25,7 +25,7 @@ public interface AppConstant {
|
||||
/**
|
||||
* 应用版本
|
||||
*/
|
||||
String APPLICATION_VERSION = "2.6.2";
|
||||
String APPLICATION_VERSION = "2.7.0";
|
||||
|
||||
/**
|
||||
* 基础包
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -18,6 +18,8 @@ package org.springblade.core.mp.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
@ -37,8 +39,9 @@ public class BaseEntity implements Serializable {
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Integer createUser;
|
||||
private Long createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
@ -51,8 +54,9 @@ public class BaseEntity implements Serializable {
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private Integer updateUser;
|
||||
private Long updateUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
|
@ -34,6 +34,6 @@ public interface BaseService<T> extends IService<T> {
|
||||
* @param ids id集合(逗号分隔)
|
||||
* @return boolean
|
||||
*/
|
||||
boolean deleteLogic(@NotEmpty List<Integer> ids);
|
||||
boolean deleteLogic(@NotEmpty List<Long> ids);
|
||||
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class BaseServiceImpl<M extends BaseMapper<T>, T extends BaseEntity> exte
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteLogic(@NotEmpty List<Integer> ids) {
|
||||
public boolean deleteLogic(@NotEmpty List<Long> ids) {
|
||||
return super.removeByIds(ids);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -39,7 +39,7 @@ public class BladeUser implements Serializable {
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Integer userId;
|
||||
private Long userId;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
|
@ -27,6 +27,7 @@ import org.springblade.core.secure.constant.SecureConstant;
|
||||
import org.springblade.core.secure.exception.SecureException;
|
||||
import org.springblade.core.secure.provider.IClientDetails;
|
||||
import org.springblade.core.secure.provider.IClientDetailsService;
|
||||
import org.springblade.core.tool.constant.RoleConstant;
|
||||
import org.springblade.core.tool.utils.*;
|
||||
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
@ -94,7 +95,7 @@ public class SecureUtil {
|
||||
return null;
|
||||
}
|
||||
String clientId = Func.toStr(claims.get(SecureUtil.CLIENT_ID));
|
||||
Integer userId = Func.toInt(claims.get(SecureUtil.USER_ID));
|
||||
Long userId = Func.toLong(claims.get(SecureUtil.USER_ID));
|
||||
String tenantId = Func.toStr(claims.get(SecureUtil.TENANT_ID));
|
||||
String roleId = Func.toStr(claims.get(SecureUtil.ROLE_ID));
|
||||
String account = Func.toStr(claims.get(SecureUtil.ACCOUNT));
|
||||
@ -111,13 +112,21 @@ public class SecureUtil {
|
||||
return bladeUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为超管
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public static boolean isAdministrator() {
|
||||
return StringUtil.containsAny(getUserRole(), RoleConstant.ADMIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户id
|
||||
*
|
||||
* @return userId
|
||||
*/
|
||||
public static Integer getUserId() {
|
||||
public static Long getUserId() {
|
||||
BladeUser user = getUser();
|
||||
return (null == user) ? -1 : user.getUserId();
|
||||
}
|
||||
@ -128,7 +137,7 @@ public class SecureUtil {
|
||||
* @param request request
|
||||
* @return userId
|
||||
*/
|
||||
public static Integer getUserId(HttpServletRequest request) {
|
||||
public static Long getUserId(HttpServletRequest request) {
|
||||
BladeUser user = getUser(request);
|
||||
return (null == user) ? -1 : user.getUserId();
|
||||
}
|
||||
@ -246,12 +255,17 @@ public class SecureUtil {
|
||||
*/
|
||||
public static Claims getClaims(HttpServletRequest request) {
|
||||
String auth = request.getHeader(SecureUtil.HEADER);
|
||||
if ((auth != null) && (auth.length() > AUTH_LENGTH)) {
|
||||
if (StringUtil.isNotBlank(auth) && auth.length() > AUTH_LENGTH) {
|
||||
String headStr = auth.substring(0, 6).toLowerCase();
|
||||
if (headStr.compareTo(SecureUtil.BEARER) == 0) {
|
||||
auth = auth.substring(7);
|
||||
return SecureUtil.parseJWT(auth);
|
||||
}
|
||||
} else {
|
||||
String parameter = request.getParameter(SecureUtil.HEADER);
|
||||
if (StringUtil.isNotBlank(parameter)) {
|
||||
return SecureUtil.parseJWT(parameter);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -55,7 +55,7 @@ public class SwaggerProperties {
|
||||
/**
|
||||
* 版本
|
||||
**/
|
||||
private String version = "2.6.2";
|
||||
private String version = "2.7.0";
|
||||
/**
|
||||
* 许可证
|
||||
**/
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -16,6 +16,8 @@
|
||||
package org.springblade.core.tool.node;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -29,15 +31,19 @@ import java.util.List;
|
||||
@Data
|
||||
public class BaseNode implements INode {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
protected Integer id;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
protected Long id;
|
||||
|
||||
/**
|
||||
* 父节点ID
|
||||
*/
|
||||
protected Integer parentId;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
protected Long parentId;
|
||||
|
||||
/**
|
||||
* 子孙节点
|
||||
|
@ -28,12 +28,14 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ForestNode extends BaseNode {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 节点内容
|
||||
*/
|
||||
private Object content;
|
||||
|
||||
public ForestNode(Integer id, Integer parentId, Object content) {
|
||||
public ForestNode(Long id, Long parentId, Object content) {
|
||||
this.id = id;
|
||||
this.parentId = parentId;
|
||||
this.content = content;
|
||||
|
@ -33,7 +33,7 @@ public class ForestNodeManager<T extends INode> {
|
||||
/**
|
||||
* 森林的父节点ID
|
||||
*/
|
||||
private List<Integer> parentIds = new ArrayList<>();
|
||||
private List<Long> parentIds = new ArrayList<>();
|
||||
|
||||
public ForestNodeManager(List<T> items) {
|
||||
list = items;
|
||||
@ -45,9 +45,9 @@ public class ForestNodeManager<T extends INode> {
|
||||
* @param id 节点ID
|
||||
* @return 对应的节点对象
|
||||
*/
|
||||
public INode getTreeNodeAT(int id) {
|
||||
public INode getTreeNodeAT(Long id) {
|
||||
for (INode forestNode : list) {
|
||||
if (forestNode.getId() == id) {
|
||||
if (forestNode.getId().longValue() == id) {
|
||||
return forestNode;
|
||||
}
|
||||
}
|
||||
@ -59,7 +59,7 @@ public class ForestNodeManager<T extends INode> {
|
||||
*
|
||||
* @param parentId 父节点ID
|
||||
*/
|
||||
public void addParentId(Integer parentId) {
|
||||
public void addParentId(Long parentId) {
|
||||
parentIds.add(parentId);
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.springblade.core.tool.node;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -22,21 +23,21 @@ import java.util.List;
|
||||
*
|
||||
* @author Chill
|
||||
*/
|
||||
public interface INode {
|
||||
public interface INode extends Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*
|
||||
* @return Integer
|
||||
*/
|
||||
Integer getId();
|
||||
Long getId();
|
||||
|
||||
/**
|
||||
* 父主键
|
||||
*
|
||||
* @return Integer
|
||||
*/
|
||||
Integer getParentId();
|
||||
Long getParentId();
|
||||
|
||||
/**
|
||||
* 子孙节点
|
||||
|
@ -14,16 +14,16 @@ public class NodeTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<ForestNode> list = new ArrayList<>();
|
||||
list.add(new ForestNode(1, 0, "1"));
|
||||
list.add(new ForestNode(2, 0, "2"));
|
||||
list.add(new ForestNode(3, 1, "3"));
|
||||
list.add(new ForestNode(4, 2, "4"));
|
||||
list.add(new ForestNode(5, 3, "5"));
|
||||
list.add(new ForestNode(6, 4, "6"));
|
||||
list.add(new ForestNode(7, 3, "7"));
|
||||
list.add(new ForestNode(8, 5, "8"));
|
||||
list.add(new ForestNode(9, 6, "9"));
|
||||
list.add(new ForestNode(10, 9, "10"));
|
||||
list.add(new ForestNode(1L, 0L, "1"));
|
||||
list.add(new ForestNode(2L, 0L, "2"));
|
||||
list.add(new ForestNode(3L, 1L, "3"));
|
||||
list.add(new ForestNode(4L, 2L, "4"));
|
||||
list.add(new ForestNode(5L, 3L, "5"));
|
||||
list.add(new ForestNode(6L, 4L, "6"));
|
||||
list.add(new ForestNode(7L, 3L, "7"));
|
||||
list.add(new ForestNode(8L, 5L, "8"));
|
||||
list.add(new ForestNode(9L, 6L, "9"));
|
||||
list.add(new ForestNode(10L, 9L, "10"));
|
||||
List<ForestNode> tns = ForestNodeMerger.merge(list);
|
||||
tns.forEach(node ->
|
||||
System.out.println(JsonUtil.toJson(node))
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springblade.core.tool.node;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -27,10 +29,14 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class TreeNode extends BaseNode {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String title;
|
||||
|
||||
private Integer key;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long key;
|
||||
|
||||
private Integer value;
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long value;
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<groupId>org.springblade</groupId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
4
pom.xml
4
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>org.springblade</groupId>
|
||||
<artifactId>blade-tool</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.7.0</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>blade-tool</name>
|
||||
<description>
|
||||
@ -36,7 +36,7 @@
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<blade.tool.version>2.6.2</blade.tool.version>
|
||||
<blade.tool.version>2.7.0</blade.tool.version>
|
||||
|
||||
<java.version>1.8</java.version>
|
||||
<maven.plugin.version>3.8.0</maven.plugin.version>
|
||||
|
Loading…
Reference in New Issue
Block a user