package me.zhengjie.modules.system.service.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Getter;
import lombok.Setter;
import me.zhengjie.base.BaseDTO;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
* @author Zheng Jie
* @date 2019-03-25
*/
@Getter
@Setter
public class DeptDTO extends BaseDTO {

    // ID
    private Long id;

    // 名称
    private String name;

    @NotNull
    private Boolean enabled;

    // 上级部门
    private Long pid;

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

    public String getLabel() {
        return name;
    }
}