package com.yunfeiyun.agmp.fms.domain.resvo;

import com.yunfeiyun.agmp.common.enums.DictTypeEnums;
import com.yunfeiyun.agmp.common.utils.DictUtils;
import com.yunfeiyun.agmp.fms.domain.FmsMach;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;

@Data
public class FmsMachAppMapResVo {
    private String id;
    private String name;
    private List<FmsMach> contents;

    public String getName() {
        return DictUtils.getDictLabel(DictTypeEnums.FMS_MACH_TYPE.getCode(), id);
    }

    public List<FmsMach> getContents() {
        if (CollectionUtils.isEmpty(contents)) {
            this.contents = new ArrayList<>();
        }
        return contents;
    }
}
