package org.xyzh.common.vo;

import org.xyzh.common.dto.BaseDTO;
import org.xyzh.common.dto.study.TbCourseNode;
import org.xyzh.common.dto.study.TbCourseChapter;

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

public class ChapterVO extends BaseDTO{
    private static final long serialVersionUID = 1L;

    private TbCourseChapter chapter;
    private List<TbCourseNode> nodes;

    public TbCourseChapter getChapter() {
        return chapter;
    }
    public void setChapter(TbCourseChapter chapter) {
        this.chapter = chapter;
    }
    public List<TbCourseNode> getNodes() {
        return nodes;
    }
    public void setNodes(List<TbCourseNode> nodes) {
        this.nodes = nodes;
    }

    public void addNode(TbCourseNode node) {
        if (nodes == null) {
            nodes = new ArrayList<>();
        }
        nodes.add(node);
    }
}
