package com.ningdatech.carapi.sys.entity.dto;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * <p>
 * 级联字典实体
 * </p>
 *
 * @author PoffyZhang
 * @since 2023/5/11
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel(value = "CascadeCodeDTO", description = "用于级联返回")
public class CascadeCodeDTO {

    public static CascadeCodeDTO of(String code, String name) {
        return new CascadeCodeDTO(code, name, null);
    }

    public static CascadeCodeDTO of(String code, String name, List<CascadeCodeDTO> list) {
        return new CascadeCodeDTO(code, name, list);
    }

    private String code;

    private String name;

    private List<CascadeCodeDTO> children;

}
