package jnpf.model.cultivate.dto.position.web;

import jnpf.model.cultivate.po.FtbCultivatePositionCourseCertificate;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * @author fantaibao
 * @date 2023/12/17
 */
@Data
public class FtbCultivatePositionJobLearnCourseCertificateDTO {
    /**
     * 证书主键ID
     */
    @NotBlank(message = "未选择证书")
    private String certificateId;

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

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

    /**
     * 课程主键ID
     */
    @NotBlank(message = "课程主键ID不能为空")
    private String courseId;

    public FtbCultivatePositionCourseCertificate convert(FtbCultivatePositionJobLearnCourseCertificateDTO ftbCultivatePositionJobLearnCourseCertificateDTO) {
        if (ftbCultivatePositionJobLearnCourseCertificateDTO == null) {
            return null;
        }
        FtbCultivatePositionCourseCertificate ftbCultivatePositionCourseCertificate = new FtbCultivatePositionCourseCertificate();
        ftbCultivatePositionCourseCertificate.setCertificateId(ftbCultivatePositionJobLearnCourseCertificateDTO.getCertificateId());
        ftbCultivatePositionCourseCertificate.setPostLearnId(ftbCultivatePositionJobLearnCourseCertificateDTO.getPostLearnId());
        ftbCultivatePositionCourseCertificate.setPostRankId(ftbCultivatePositionJobLearnCourseCertificateDTO.getPostRankId());
        ftbCultivatePositionCourseCertificate.setCourseId(ftbCultivatePositionJobLearnCourseCertificateDTO.getCourseId());
        return ftbCultivatePositionCourseCertificate;
    }

}
