update 优化 TreeEntity 树实体 去除未知泛型

feature/model
疯狂的狮子li 3 years ago
parent 51fba42b83
commit 3341eb5f2c

@ -16,7 +16,7 @@ import java.util.List;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
public class TreeEntity extends BaseEntity { public class TreeEntity<T> extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -38,6 +38,6 @@ public class TreeEntity extends BaseEntity {
*/ */
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "子部门") @ApiModelProperty(value = "子部门")
private List<?> children = new ArrayList<>(); private List<T> children = new ArrayList<>();
} }

@ -24,7 +24,7 @@ import javax.validation.constraints.Size;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("sys_dept") @TableName("sys_dept")
@ApiModel("部门业务对象") @ApiModel("部门业务对象")
public class SysDept extends TreeEntity { public class SysDept extends TreeEntity<SysDept> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**

@ -23,7 +23,7 @@ import javax.validation.constraints.Size;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("sys_menu") @TableName("sys_menu")
@ApiModel("菜单权限业务对象") @ApiModel("菜单权限业务对象")
public class SysMenu extends TreeEntity { public class SysMenu extends TreeEntity<SysMenu> {
/** /**
* ID * ID

@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("test_tree") @TableName("test_tree")
public class TestTree extends TreeEntity { public class TestTree extends TreeEntity<TestTree> {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -21,7 +21,7 @@ import javax.validation.constraints.NotNull;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ApiModel("测试树表业务对象") @ApiModel("测试树表业务对象")
public class TestTreeBo extends TreeEntity { public class TestTreeBo extends TreeEntity<TestTreeBo> {
/** /**
* *

@ -28,7 +28,7 @@ import com.ruoyi.common.core.domain.TreeEntity;
#if($table.crud || $table.sub) #if($table.crud || $table.sub)
#set($Entity="BaseEntity") #set($Entity="BaseEntity")
#elseif($table.tree) #elseif($table.tree)
#set($Entity="TreeEntity") #set($Entity="TreeEntity<${ClassName}Bo>")
#end #end
@Data @Data

@ -25,7 +25,7 @@ import com.ruoyi.common.core.domain.TreeEntity;
#if($table.crud || $table.sub) #if($table.crud || $table.sub)
#set($Entity="BaseEntity") #set($Entity="BaseEntity")
#elseif($table.tree) #elseif($table.tree)
#set($Entity="TreeEntity") #set($Entity="TreeEntity<${ClassName}>")
#end #end
@Data @Data
@TableName("${tableName}") @TableName("${tableName}")

@ -143,7 +143,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
router.setComponent(getComponent(menu)); router.setComponent(getComponent(menu));
router.setQuery(menu.getQueryParam()); router.setQuery(menu.getQueryParam());
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
List<SysMenu> cMenus = (List<SysMenu>) menu.getChildren(); List<SysMenu> cMenus = menu.getChildren();
if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) { if (!cMenus.isEmpty() && UserConstants.TYPE_DIR.equals(menu.getMenuType())) {
router.setAlwaysShow(true); router.setAlwaysShow(true);
router.setRedirect("noRedirect"); router.setRedirect("noRedirect");

Loading…
Cancel
Save