perf:权限增加一个source字段,用于标记权限来源
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package com.tiesheng.role.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.tiesheng.util.pojos.DaoBase;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 角色-权限
|
||||
@@ -81,6 +84,12 @@ public class CoreRoleAuthority extends DaoBase {
|
||||
@TableField(value = "version")
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 权限来源:auto-自动生成,input-添加
|
||||
*/
|
||||
@TableField(value = "`source`")
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 扩展1
|
||||
*/
|
||||
@@ -315,6 +324,24 @@ public class CoreRoleAuthority extends DaoBase {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限来源:auto-自动生成,input-添加
|
||||
*
|
||||
* @return source - 权限来源:auto-自动生成,input-添加
|
||||
*/
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置权限来源:auto-自动生成,input-添加
|
||||
*
|
||||
* @param source 权限来源:auto-自动生成,input-添加
|
||||
*/
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展1
|
||||
*
|
||||
@@ -368,4 +395,4 @@ public class CoreRoleAuthority extends DaoBase {
|
||||
public void setExt3(String ext3) {
|
||||
this.ext3 = ext3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,6 +263,7 @@ public class CoreRoleService extends TsServiceBase<CoreRoleGroupMapper, CoreRole
|
||||
|
||||
coreRoleAuthorityMapper.delete(new QueryWrapper<CoreRoleAuthority>()
|
||||
.ne("version", version)
|
||||
.ne("source", "auto")
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class RoleAuthorityHandler implements TsAuthorityHandler {
|
||||
groupAuthority.setPlatform(menuPlatform);
|
||||
groupAuthority.setParent(parentId);
|
||||
groupAuthority.setVersion(version);
|
||||
groupAuthority.setSource("auto");
|
||||
groupAuthority.setId(StrUtil.join("_", groupAuthority.getService(), groupAuthority.getNo()));
|
||||
list.add(groupAuthority);
|
||||
}
|
||||
@@ -72,6 +73,7 @@ public class RoleAuthorityHandler implements TsAuthorityHandler {
|
||||
menuAuthority.setParent(groupAuthority.getId());
|
||||
menuAuthority.setPlatform(menuPlatform);
|
||||
menuAuthority.setVersion(version);
|
||||
menuAuthority.setSource("auto");
|
||||
menuAuthority.setId(StrUtil.join("_", menuAuthority.getService(), menuAuthority.getNo()));
|
||||
list.add(menuAuthority);
|
||||
|
||||
@@ -85,6 +87,7 @@ public class RoleAuthorityHandler implements TsAuthorityHandler {
|
||||
point.setLevel(menuAuthority.getLevel() + 1);
|
||||
point.setParent(menuAuthority.getId());
|
||||
point.setVersion(version);
|
||||
point.setSource("auto");
|
||||
point.setPlatform(StrUtil.emptyToDefault(authority.platform(), menuPlatform));
|
||||
point.setId(StrUtil.join("_", point.getService(), point.getNo()));
|
||||
list.add(point);
|
||||
|
||||
Reference in New Issue
Block a user