package jnpf.model.cultivate.v2.task.vo;

import jnpf.model.cultivate.v2.enums.PositionBusinessSourceEnum;
import jnpf.model.cultivate.v2.position.vo.BusinessSourceVo;
import lombok.Data;

import java.io.Serializable;

@Data
public class V2CultivateLearnTaskCourseVo extends BusinessSourceVo implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    private String id;


    /**
     * 课程主键id
     */
    private String courseId;

    /**
     * 课程名称
     */
    private String courseName;

    /**
     * 是否必修(0是1否)
     */
    private Integer isRequired;

    /**
     * 具体人的时候：学习状态 1-已学习，0-未学习,2-学习中
     */
    private Integer learnState;

    /**
     * 学习时长,单位秒
     */
    private Integer learnTime;

    /**
     * 学习进度
     */
    private String learnProgress;
    /**
     * 排序字段
     */
    private Integer sortCode;

    public void convert(FtbCultivateLearnTaskCourseVo course) {
        this.setId(course.getId());
        this.setCourseId(course.getCourseId());
        this.setIsRequired(course.getIsRequired());
        this.setSortCode(course.getSortCode());
        this.setBusinessSourceId(course.getTaskId());
        this.setBusinessSource(PositionBusinessSourceEnum.TASK_LEARNING);
    }
}
