package com.rc.httpcore.vo.response;

/**
 * info
 *
 * @author ReiChin_
 */
public class LearnRecordVo {

    public String cateId; // 分类ID
    public String cateTitle; // 分类标题
    public String courseId; // 课程ID
    public String courseTitle; // 课程标题
    public String title; // 课程标题
    public String learnTime; // 学习时间
    public String learnDuration; // 学习时长
    public String learnDurationStr;
    public String bonusPoints; // 获得奖励分
    public String joinUserId;// ": 22

    public String scopeType; // 适用范围(1. 安全准入考试，2. 负面清单考试，3. 黑名单考试)
    public String learnStatus; //  0 学习中，2 未学习，3 待考核，1 已完成

    public String decodeScopeType() {
        if (null == scopeType || scopeType.isEmpty()) {
            return "";
        }
        String[] array = scopeType.split(",");
        StringBuilder builder = new StringBuilder();
        for (String type : array) {
            builder.append(decodeScopeType(type)).append("、");
        }
        if (builder.length() > 0) {
            builder.deleteCharAt(builder.length() -1);
        }
        return builder.toString();
    }

    private String decodeScopeType(String type) {
        if ("1".equals(type)) {
            return "安全准入考试";
        } else if ("2".equals(type)) {
            return "负面清单考试";
        } else if ("3".equals(type)) {
            return "黑名单考试";
        }
        return "";
    }

    public String decodeLearnStatus() {
        if ("0".equals(learnStatus)) {
            return "学习中";
        } else if ("1".equals(learnStatus)) {
            return "已完成";
        } else if ("2".equals(learnStatus)) {
            return "未学习";
        } else if ("3".equals(learnStatus)) {
            return "待考核";
        }
        return "";
    }

}
