package com.bcxin.risk.user.dto.data;

import lombok.Data;

import java.util.Map;

/**
 * Created by Administrator on 2017/5/15 0015.
 */
@Data
public class MenuDataDto {

    private String oid;

    private String parent_id;

    private String menuCode;//编码规则 01 0101 010101

    private String menuName;

    private String menuDesc;

    private String menuType;

    private String xzbz;  //选择标志


    public MenuDataDto(Map<String,Object> map){
        this.oid = safeTransfor(map.get("oid"));
        this.parent_id = safeTransfor(map.get("parent_id"));
        this.menuCode = safeTransfor(map.get("menuCode"));
        this.menuName = safeTransfor(map.get("menuName"));
        this.menuDesc = safeTransfor(map.get("menuDesc"));
        this.menuType = safeTransfor(map.get("menuType"));
        this.xzbz = safeTransfor(map.get("xzbz"));
    }

    private String safeTransfor(Object obj){
        if ( obj == null ) {
            return "";
        }
        return obj.toString();
    }
}
