package com.yuchen.saas.manage.system.api.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.yuchen.saas.manage.system.api.entity.NestFeature;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nest.springwrap.core.tool.node.INode;

import java.util.ArrayList;
import java.util.List;


@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "FeatureVO对象", description = "FeatureVO对象")
public class FeatureVO extends NestFeature implements INode<FeatureVO> {
	private static final long serialVersionUID = 1L;

	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	@JsonSerialize(using = ToStringSerializer.class)
	private Long parentId;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<FeatureVO> children;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private Boolean hasChildren;

	@Override
	public List<FeatureVO> getChildren() {
		if (this.children == null) {
			this.children = new ArrayList<>();
		}
		return this.children;
	}

	private String parentName;

//	@JsonSerialize(
//			using = ToStringSerializer.class
//	)
//	@ApiModelProperty("创建人")
//	private Long createUser;
//	@JsonSerialize(
//			using = ToStringSerializer.class
//	)
//	@ApiModelProperty("创建部门")
//	private Long createDept;
//	@DateTimeFormat(
//			pattern = "yyyy-MM-dd HH:mm:ss"
//	)
//	@JsonFormat(
//			pattern = "yyyy-MM-dd HH:mm:ss"
//	)
//	@ApiModelProperty("创建时间")
//	private Date createTime;
//	@JsonSerialize(
//			using = ToStringSerializer.class
//	)
//	@ApiModelProperty("更新人")
//	private Long updateUser;
//	@DateTimeFormat(
//			pattern = "yyyy-MM-dd HH:mm:ss"
//	)
//	@JsonFormat(
//			pattern = "yyyy-MM-dd HH:mm:ss"
//	)
//	@ApiModelProperty("更新时间")
//	private Date updateTime;
//	@ApiModelProperty("业务状态")
//	private Integer status;
//	@TableLogic
//	@ApiModelProperty("是否已删除")
//	private Integer isDeleted;
}
