mirror of
https://github.com/chillzhuang/blade-tool
synced 2024-12-12 20:29:27 +08:00
⚡ 优化代码,children为空则不序列化
This commit is contained in:
parent
716448593e
commit
4afe559cf0
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.springblade.core.tool.node;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -28,8 +29,20 @@ import java.util.List;
|
||||
@Data
|
||||
public class BaseNode implements INode {
|
||||
|
||||
protected Integer id;//主键ID
|
||||
protected Integer parentId;//父节点ID
|
||||
protected List<INode> children = new ArrayList<>();//子孙节点
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
protected Integer id;
|
||||
|
||||
/**
|
||||
* 父节点ID
|
||||
*/
|
||||
protected Integer parentId;
|
||||
|
||||
/**
|
||||
* 子孙节点
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
protected List<INode> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user