package com.wisewoods.base.bean;

import com.blankj.utilcode.util.GsonUtils;
import com.google.gson.reflect.TypeToken;

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

public class VoteInfo extends Results<VoteInfo.ListBean> {
    public static class ListBean {
        public List<VoteInfo.DataBean> rows;
        public long total;
    }

    public static class DataBean {

        public long id;
        public int isAnony;
        public long meetingId;
        public String prepName;
        public Object params;
        public String userid;
        public String voteDesc;
        public String voteId;
        public String voteOptList;
        public String voteTopic;
        public int voteTotalNum;
        public int voteType;

        public List<VoteListBean> getVoteList() {
            if (voteOptList != null) {
                List<VoteListBean> list = GsonUtils.fromJson(voteOptList, new TypeToken<List<VoteListBean>>() {
                }.getType());
                return list;
            } else {
                return new ArrayList<>();
            }
        }

    }

    public static class VoteListBean {
        public String opt_desc;
        public String opt_id;
        public int opt_number;
        public List<VoteUserBean> opt_user_list;
    }

    public static class VoteUserBean {
        public String nick_name;
    }
}
