package com.rv.home.rv.module.ui.main.home.bean;

import com.ruiwenliu.wrapper.base.BaseBean;
import com.rv.home.rv.module.basic.bean.MultiItemBean;
import com.rv.home.rv.module.ui.main.home.adapter.AttributeListAdapter;

import java.util.List;

/**
 * Created :Auser
 * Date: 2019/5/23.
 * Desc:车辆赛选属性
 */

public class CarAttributeListBean extends BaseBean{

    /**
     * data : {"cata":[{"level":1,"children":[{"level":2,"children":[],"name":"敞篷房车","id":3,"parentId":1},{"level":2,"children":[],"name":"小雨滴","id":4,"parentId":1},{"level":2,"children":[],"name":"考斯拉","id":5,"parentId":1},{"level":2,"children":[],"name":"福特","id":6,"parentId":1}],"name":"品牌","id":1,"parentId":0},{"level":1,"children":[{"level":2,"children":[],"name":"拖挂式","id":8,"parentId":7},{"level":2,"children":[],"name":"自动式B型","id":9,"parentId":7},{"level":2,"children":[],"name":"自动式C型","id":10,"parentId":7}],"name":"车型","id":7,"parentId":0},{"level":1,"children":[{"level":2,"children":[],"name":"C1","id":12,"parentId":11},{"level":2,"children":[],"name":"A1","id":13,"parentId":11}],"name":"准架","id":11,"parentId":0},{"level":1,"children":[{"level":2,"children":[],"name":"6乘6卧","id":15,"parentId":14},{"level":2,"children":[],"name":"5乘5卧","id":16,"parentId":14},{"level":2,"children":[],"name":"4乘4卧","id":17,"parentId":14}],"name":"乘位卧位","id":14,"parentId":0},{"level":1,"children":[{"level":2,"children":[],"name":"1000-1500","id":19,"parentId":18},{"level":2,"children":[],"name":"1500-2000","id":20,"parentId":18},{"level":2,"children":[],"name":"2000-3000","id":21,"parentId":18}],"name":"价格区间(单位:元)","id":18,"parentId":0}]}
     * code : 1
     */

    private DataBean data;
    private int code;

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public static class DataBean {
        public List<CataBean> cata;

        public List<CataBean> getCata() {
            return cata;
        }

        public void setCata(List<CataBean> cata) {
            this.cata = cata;
        }

        public static class CataBean implements MultiItemBean {
            /**
             * level : 1
             * children : [{"level":2,"children":[],"name":"敞篷房车","id":3,"parentId":1},{"level":2,"children":[],"name":"小雨滴","id":4,"parentId":1},{"level":2,"children":[],"name":"考斯拉","id":5,"parentId":1},{"level":2,"children":[],"name":"福特","id":6,"parentId":1}]
             * name : 品牌
             * id : 1
             * parentId : 0
             */
            @Override
            public int getSpanSize() {
                return 6;
            }

            @Override
            public int getItemType() {
                return AttributeListAdapter.TYPE_ATTRIBUTE_TYPE;
            }
            private int level;
            private String name;
            private int id;
            private int parentId;
            private List<ChildrenBean> children;

            public int getLevel() {
                return level;
            }

            public void setLevel(int level) {
                this.level = level;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public int getParentId() {
                return parentId;
            }

            public void setParentId(int parentId) {
                this.parentId = parentId;
            }

            public List<ChildrenBean> getChildren() {
                return children;
            }

            public void setChildren(List<ChildrenBean> children) {
                this.children = children;
            }

            public static class ChildrenBean implements MultiItemBean{
                /**
                 * level : 2
                 * children : []
                 * name : 敞篷房车
                 * id : 3
                 * parentId : 1
                 */
                public int isSelect;
                private int level;
                private String name;
                private int id;
                private int parentId;
                private boolean isShow;
                private List<?> children;

                public int getLevel() {
                    return level;
                }

                public void setLevel(int level) {
                    this.level = level;
                }

                public String getName() {
                    return name;
                }

                public void setName(String name) {
                    this.name = name;
                }

                public int getId() {
                    return id;
                }

                public void setId(int id) {
                    this.id = id;
                }

                public int getParentId() {
                    return parentId;
                }

                public void setParentId(int parentId) {
                    this.parentId = parentId;
                }

                public List<?> getChildren() {
                    return children;
                }

                public void setChildren(List<?> children) {
                    this.children = children;
                }

                public boolean isShow() {
                    return isShow;
                }

                public void setShow(boolean show) {
                    isShow = show;
                }

                @Override
                public int getSpanSize() {
                    return 2;
                }

                @Override
                public int getItemType() {
                    return AttributeListAdapter.TYPE_ATTRIBUTE_NAME;
                }
            }
        }
    }
}
