package com.microservices.pms.productLibrary.domain.vo;

import com.microservices.common.core.utils.bean.BeanUtils;
import com.microservices.common.core.web.domain.BaseEntity;
import com.microservices.pms.document.domain.vo.PmsDocumentSearchVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 制品搜索对象
 *
 * @author otto
 * @date 2024-07-04
 */
@Data
@ApiModel("知识库文档搜索对象")
public class DocSearchVo extends BaseEntity {
    /**
     * 文档名称
     */
    @ApiModelProperty(value = "文档名称")
    private String name;

    /**
     * 文件类型 1-文档目录 2-文档 3-附件 4-wiki库
     */
    @ApiModelProperty(value = "文件类型 1-文档目录 2-文档 3-附件 4-wiki库")
    private Integer docType;

    /**
     * 父级id
     */
    @ApiModelProperty(value = "父级id", required = true)
    @NotNull
    private Long parentId;

    /**
     * 项目ID
     */
    @ApiModelProperty(value = "项目ID")
    private Long pmsProjectId;


    @ApiModelProperty(value = "企业标识", hidden = true)
    private String enterpriseIdentifier;


    @ApiModelProperty(value = "产品库标识", hidden = true)
    private String productRepoName;

    public PmsDocumentSearchVo toPmsDocumentSearchVo(Long pmsEnterpriseId) {
        PmsDocumentSearchVo target = new PmsDocumentSearchVo();
        BeanUtils.copyProperties(this, target);
        target.setPmsEnterpriseId(pmsEnterpriseId);
        target.setNotIncludeWiki(true);
        return target;
    }
}
