package jnpf.model.cultivate.vo.casebase;

import jnpf.model.cultivate.po.casebase.FtbCultivateCaseBase;
import jnpf.model.cultivate.vo.offline.FtbCultivateOfflineFileVO;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @Title:
 * @Author: peng.hao
 * @create: 2024/7/22:13:47
 */
@Data
public class FtbCultivateCaseBaseVO {

    private String id;

    /** 案例名称 */
    private String caseName;

    /**系统展示案例ID */
    private String  systemCaseId;

    /** 案例描述 */
    private String caseDescription;

    /** 状态 0:草稿 1:待审核, 2 审核通过, 3 审核不通过 */
    private Integer status;
    /**
     * 创建时间
     */
    private Date creatorTime;

    /**
     * 创建人
     */
    private String creatorUserId;
    /**
     * 创建人
     */
    private String creatorUserName;
    /**
     * 更新时间
     */
    private Date  lastModifyTime;

    /** 审核意见 */
    private String auditOpinion;

    /** 审核时间 */
    private Date auditTime;

    /** 审核用户id */
    private String auditUserId;
    /** 审核用户Name */
    private String auditUserName;

    /**
     * 点赞数
     */
    private Integer numberOfLikes;
    /**
     * 是否已经点赞 1:已点赞 0:未点赞
     */
    private Integer haveYouLikedIt;


    /**
     * 附件信息上限20个
     */
    List<FtbCultivateOfflineFileVO> files;

    /**
     * 是否具有审核权限, 0否 1是
     */
    private String auditPermissions;

    public static FtbCultivateCaseBaseVO convert(FtbCultivateCaseBase entity) {
        if (entity == null) {
            return null;
        }
        FtbCultivateCaseBaseVO ftbCultivateCaseBaseVO = new FtbCultivateCaseBaseVO();
        ftbCultivateCaseBaseVO.setCaseName(entity.getCaseName());
        ftbCultivateCaseBaseVO.setSystemCaseId(entity.getSystemCaseId());
        ftbCultivateCaseBaseVO.setStatus(entity.getStatus());
        ftbCultivateCaseBaseVO.setCaseDescription(entity.getCaseDescription());
        ftbCultivateCaseBaseVO.setLastModifyTime(entity.getLastModifyTime());
        ftbCultivateCaseBaseVO.setCreatorTime(entity.getCreatorTime());
        ftbCultivateCaseBaseVO.setCreatorUserId(entity.getCreatorUserId());
        ftbCultivateCaseBaseVO.setId(entity.getId());
        ftbCultivateCaseBaseVO.setAuditOpinion(entity.getAuditOpinion());
        ftbCultivateCaseBaseVO.setAuditTime(entity.getAuditTime());
        ftbCultivateCaseBaseVO.setAuditUserId(entity.getAuditUserId());
        return ftbCultivateCaseBaseVO;
    }
}
