package jnpf.model.cultivate.dto.position;

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

import javax.validation.constraints.NotBlank;

/**
 * 添加岗位学习证书
 *
 * @author fantaibao
 * @date 2023/12/17
 */
@Data
public class FtbCultivatePositionJobLearnCertificateDTO {
    /**
     * 证书主键ID
     */
    @NotBlank(message = "未选择证书")
    private String certificateId;

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

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

    public FtbCultivatePositionCertificate convertFtbCultivatePositionCertificate(FtbCultivatePositionJobLearnCertificateDTO certificateDTO) {
        if (certificateDTO == null) {
            return null;
        }
        FtbCultivatePositionCertificate ftbCultivatePositionCertificate = new FtbCultivatePositionCertificate();
        ftbCultivatePositionCertificate.setCertificateId(certificateDTO.getCertificateId());
        ftbCultivatePositionCertificate.setPostLearnId(certificateDTO.getPostLearnId());
        ftbCultivatePositionCertificate.setPostRankId(certificateDTO.getPostRankId());
        return ftbCultivatePositionCertificate;
    }

}
