package com.hz.pm.api.user.model.dto;

import com.ningdatech.basic.model.ITree;
import lombok.Data;

import java.util.Comparator;
import java.util.List;

/**
 * <p>
 * MhUnitTreeDTO
 * </p>
 *
 * @author WendyYang
 * @since 15:29 2024/1/10
 */
@Data
public class MhUnitTreeDTO implements ITree<Long, MhUnitTreeDTO> {

    private Long id;

    private String name;

    private Long parentId;

    private Short sort;

    private List<MhUnitTreeDTO> children;

    @Override
    public Comparator<? super MhUnitTreeDTO> comparator() {
        return Comparator.comparing(MhUnitTreeDTO::getSort);
    }

}
