package com.zd.exam.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zd.common.core.annotation.Excel;
import com.zd.exam.util.CourcseUtils;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

public class ElCourseVo {

    @Excel(name = "分类ID")
    @ApiModelProperty(value = "分类ID")
    private Long cateId;

    @ApiModelProperty(value = "适用类型")
    private String scopeType;

    @ApiModelProperty(value = "分类标题")
    private String cateTitle;

    @ApiModelProperty(value = "课程ID")
    private Long courseId;

    @ApiModelProperty(value = "课程标题")
    private String courseTitle;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "学习时间")
    private Date learnTime;

    @ApiModelProperty(value = "学习时长")
    private Long learnDuration;

    private String learnDurationStr;

    @ApiModelProperty(value = "获得奖励分")
    private Long bonusPoints;

    private Long joinUserId;

    @ApiModelProperty(value = "用户名称")
    private String nickName;

    /**
     * V2.6 增加 0 学习中，2 未学习，3 待考核，1 已完成
     */
    @ApiModelProperty(value = "0 学习中，2 未学习，3 待考核，1 已完成")
    private Integer learnStatus;

    public Long getCateId() {
        return cateId;
    }

    public void setCateId(Long cateId) {
        this.cateId = cateId;
    }

    public String getCateTitle() {
        return cateTitle;
    }

    public void setCateTitle(String cateTitle) {
        this.cateTitle = cateTitle;
    }

    public String getCourseTitle() {
        return courseTitle;
    }

    public void setCourseTitle(String courseTitle) {
        this.courseTitle = courseTitle;
    }

    public Date getLearnTime() {
        return learnTime;
    }

    public void setLearnTime(Date learnTime) {
        this.learnTime = learnTime;
    }

    public Long getBonusPoints() {
        return bonusPoints;
    }

    public void setBonusPoints(Long bonusPoints) {
        this.bonusPoints = bonusPoints;
    }

    public Long getJoinUserId() {
        return joinUserId;
    }

    public void setJoinUserId(Long joinUserId) {
        this.joinUserId = joinUserId;
    }

    public Long getLearnDuration() {
        return learnDuration;
    }

    public void setLearnDuration(Long learnDuration) {
        this.learnDuration = learnDuration;
        if(learnDuration != null){
            this.setLearnDurationStr(learnDuration);
        }
    }

    public String getLearnDurationStr() {
        return learnDurationStr;
    }

    public void setLearnDurationStr(Long learnDuration) {
        this.learnDurationStr = CourcseUtils.getTimeString(Math.toIntExact(learnDuration));
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getScopeType() {
        return scopeType;
    }

    public void setScopeType(String scopeType) {
        this.scopeType = scopeType;
    }

    public Long getCourseId() {
        return courseId;
    }

    public void setCourseId(Long courseId) {
        this.courseId = courseId;
    }

    public Integer getLearnStatus() {
        return learnStatus;
    }

    public void setLearnStatus(Integer learnStatus) {
        this.learnStatus = learnStatus;
    }
}
