package com.zhongshu.card.client.model.dictionary;

import com.zhongshu.card.client.type.DictionaryType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.stereotype.Indexed;

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

@Data
public class DictionaryItemModel {

    private String id;

    private Long createTime;

    private Long updateTime;

    //字典id
    @Schema(description = "字典id")
    private String dictionaryId;

    //父级id
    @Schema(description = "父级id")
    private String parentId;

    //唯一值
    @Schema(description = "项编码")
    private String key;

    //字典项
    @Schema(description = "项名称")
    private String name;

    @Schema(name = "description", description = "描述", example = "班级")
    private String description;

    //类型
    @Schema(description = "项类型")
    private DictionaryType type;

    //排序
    @Schema(description = "排序")
    private Integer sort;

    //禁用状态
    @Schema(description = "状态")
    private boolean disable;

    private List<DictionaryItemModel> children = new ArrayList<>();


    public void addChild(DictionaryItemModel child) {
        this.children.add(child);
    }
}
