package jnpf.model.cultivate.dto.position;

import jnpf.model.cultivate.po.position.FtbCultivatePositionCourse;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 添加岗位学习课程
 *
 * @author fantaibao
 * @date 2023/12/17
 */
@Data
public class FtbCultivatePositionLearingCourselDTO {

    /**
     * 课程主键ID
     */
    @NotNull(message = "请选择课程")
    private List<String> courseIds;

    /**
     * 岗位学习主键ID
     */
    @NotBlank(message = "岗位学习主键ID不能为空")
    private String postLearnId;

    /**
     * 岗位主键ID
     */
    @NotBlank(message = "岗位主键ID不能为空")
    private String postRankId;

    public FtbCultivatePositionCourse convertFtbCultivatePositionCourse(FtbCultivatePositionLearingCourselDTO ftbCultivatePositionLearingCourselDTO) {
        if (ftbCultivatePositionLearingCourselDTO == null) {
            return null;
        }
        FtbCultivatePositionCourse ftbCultivatePositionCourse = new FtbCultivatePositionCourse();
        ftbCultivatePositionCourse.setEnabledMark(0);
        ftbCultivatePositionCourse.setPostLearnId(ftbCultivatePositionLearingCourselDTO.getPostLearnId());
        ftbCultivatePositionCourse.setPostRankId(ftbCultivatePositionLearingCourselDTO.getPostRankId());
        return ftbCultivatePositionCourse;
    }

}
