package com.ssj.service.conch.teacher.library.dto;

import com.ssj.conch.constant.CourseConstant;
import com.ssj.service.conch.teacher.dto.LearningStateDto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class HomeworkDataDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private String pushId;

    /**
     * 学生信息
     */
    private StudentInfo childInfo;

    /**
     * 登记图片
     */
    private List<String> checkInPictureList;

    /**
     * 学习状态列表
     */
    private List<LearningStateDto> learningState;

    /***
     * 老师留言
     */
    private String suggestion;

    /**
     * 学科详情
     */

    private List<Map<String,String>> voiceKeyList;

    public List<Map<String, String>> getVoiceKeyList() {
        return voiceKeyList;
    }

    public void setVoiceKeyList(List<Map<String, String>> voiceKeyList) {
        this.voiceKeyList = voiceKeyList;
    }

    private List<SubjectHomeworkDto> subjectHomeworkList;

    public String getPushId() {
        return pushId;
    }

    public void setPushId(String pushId) {
        this.pushId = pushId;
    }

    public StudentInfo getChildInfo() {
        return childInfo;
    }

    public void setChildInfo(StudentInfo childInfo) {
        this.childInfo = childInfo;
    }

    public List<String> getCheckInPictureList() {
        return checkInPictureList;
    }

    public void setCheckInPictureList(List<String> checkInPictureList) {
        this.checkInPictureList = checkInPictureList;
    }

    public List<LearningStateDto> getLearningState() {
        return learningState;
    }

    public void setLearningState(List<LearningStateDto> learningState) {
        this.learningState = learningState;
    }

    public String getSuggestion() {
        return suggestion;
    }

    public void setSuggestion(String suggestion) {
        this.suggestion = suggestion;
    }

    public List<SubjectHomeworkDto> getSubjectHomeworkList() {
        return subjectHomeworkList;
    }

    public void setSubjectHomeworkList(List<SubjectHomeworkDto> subjectHomeworkList) {
        this.subjectHomeworkList = subjectHomeworkList;
    }

    public void addSubjectData (SubjectHomeworkDto subjectHomeworkDto) {
        if (this.subjectHomeworkList == null) {
            this.subjectHomeworkList = new ArrayList<>();
        }
        this.subjectHomeworkList.add(subjectHomeworkDto);
    }

    public void initLearningState(){
        if (this.learningState == null){
            this.learningState = new ArrayList<>();
        }
        for (String key : CourseConstant.LABEL_NAME_LIST){
            LearningStateDto item = new LearningStateDto();
            item.setName(key);
            item.setType(CourseConstant.LABEL_NAME_LIST.indexOf(key));
            this.learningState.add(item);
        }
    }
}
