package jnpf.model.cultivate.vo.certificate;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import jnpf.model.cultivate.po.certificate.FtbCertificateEntity;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * 证书
 *@author hao.peng
 */
@Data
public class FtbCertificateListVO implements Serializable {

    private static final long serialVersionUID = 1L;
    @Schema(description = "主键")
    private String id;

    @Schema(description = "创建用户")
    private String creatorUserId;

    @Schema(description = "创建用户名称")
    private String creatorUserName;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "企业名称")
    private String companyName;

    @Schema(description = "前缀")
    private String prefix;

    @Schema(description = "状态（0下架，1上架）")
    private Integer status;

    @Schema(description = "模板图片地址")
    private String template;

    @Schema(description = "有效期类型（1按月，2按天,0,长期有效）")
    private Integer expireType;

    @Schema(description = "有效期")
    private Integer expireTime;

    @Schema(description = "属性像素点位置")
    @JsonIgnore
    private String points;

    @Schema(description = "修改时间")
    private Date lastModifyTime;

    @Schema(description = "描述")
    private String reason;

    @Schema(description = "激励语")
    private String motivational;

    public static FtbCertificateListVO covertVO(FtbCertificateEntity certificate) {
        if (certificate == null) {
            return null;
        }
        FtbCertificateListVO ftbCertificateListVO = new FtbCertificateListVO();
        ftbCertificateListVO.setName(certificate.getName());
        ftbCertificateListVO.setCompanyName(certificate.getCompanyName());
        ftbCertificateListVO.setExpireType(certificate.getExpireType());
        ftbCertificateListVO.setExpireTime(certificate.getExpireTime());
        ftbCertificateListVO.setStatus(certificate.getStatus());
        ftbCertificateListVO.setTemplate(certificate.getTemplate());
        ftbCertificateListVO.setPoints(certificate.getPoints());
        ftbCertificateListVO.setReason(certificate.getReason());
        ftbCertificateListVO.setId(certificate.getId());
        ftbCertificateListVO.setLastModifyTime(certificate.getLastModifyTime());
        ftbCertificateListVO.setCreatorUserId(certificate.getCreatorUserId());
        ftbCertificateListVO.setMotivational(certificate.getMotivational());
        return ftbCertificateListVO;
    }

    ;
}