package com.ningdatech.pmapi.meta.assembler;


import com.ningdatech.pmapi.meta.model.entity.MetaDictionary;
import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO;
import com.ningdatech.pmapi.meta.model.vo.ResDictionaryVO;

/**
 * @author liuxinxin
 * @date 2022/7/22 上午10:53
 */

public class MetaDictionaryAssembler {

    public static DictionaryDTO toDictionaryDTO(MetaDictionary dictionaryManage) {
        DictionaryDTO dictionaryDTO = new DictionaryDTO();
        dictionaryDTO.setDescribe(dictionaryManage.getDictionaryDescribe());
        dictionaryDTO.setDictionaryCode(dictionaryManage.getDictionaryCode());
        dictionaryDTO.setDictionaryType(dictionaryManage.getDictionaryType());
        dictionaryDTO.setName(dictionaryManage.getDictionaryName());
        dictionaryDTO.setReadonly(dictionaryManage.getReadonly());
        dictionaryDTO.setSortValue(dictionaryManage.getSortValue());
        return dictionaryDTO;
    }

    public static ResDictionaryVO toDictionaryVO(DictionaryDTO dictionaryDTO) {
        ResDictionaryVO resDictionaryVO = new ResDictionaryVO();
        resDictionaryVO.setDescribe(dictionaryDTO.getDescribe());
        resDictionaryVO.setDictionaryCode(dictionaryDTO.getDictionaryCode());
        resDictionaryVO.setDictionaryType(dictionaryDTO.getDictionaryType());
        resDictionaryVO.setName(dictionaryDTO.getName());
        resDictionaryVO.setReadonly(dictionaryDTO.getReadonly());
        resDictionaryVO.setSortValue(dictionaryDTO.getSortValue());
        return resDictionaryVO;
    }
}
