package com.microservices.zone.resource.domain.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.microservices.common.core.utils.bean.BeanUtils;
import com.microservices.common.core.web.domain.BaseEntity;
import com.microservices.zone.resource.domain.ZoneResource;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author otto
 */
@Data
@ApiModel("资源搜索对象")
public class ZoneResourceOpenSearchVo  extends BaseEntity {
    @JsonIgnore
    private Long zoneId;
    @JsonIgnore
    private Long deptId;

    @ApiModelProperty(value = "资源名称")
    private String name;

    /**
     * 资源领域Id
     */
    @ApiModelProperty(value = "资源领域Id")
    private Long domainId;


    /**
     * 查找的资源类型Id
     */
    @ApiModelProperty(value = "查找的资源类型Id")
    private Long searchTypeId;

    /**
     * 是否首页展示（0代表不展示 1代表展示）
     */
    @ApiModelProperty(value = "是否首页展示（0代表不展示 1代表展示）")
    private String isHomepage;

    @ApiModelProperty(value = "资源标签")
    private String keywords;

    @ApiModelProperty(value = "排序列")
    private String orderByColumn;

    @ApiModelProperty(value = "排序的方向desc或者asc")
    private String isAsc = "asc";

    @ApiModelProperty(value = "是否根据下载次数降序排序（与orderByColumn互斥，该属性优先级更高）")
    private Boolean orderByDownloadCount = false;

    @ApiModelProperty(value = "审核状态（0：待审核，1：审核通过 2：审核不通过 3：已下架 4：草稿）",hidden = true)
    private String auditStatus="1";

    @ApiModelProperty(value = "资源分类：SKILL/MODEL/DATASET，NULL或者不传代表所有资源")
    private String resourceCategory;

    public ZoneResource toZoneResource() {
        ZoneResource target = new ZoneResource();
        BeanUtils.copyProperties(this, target);
        return target;
    }
}
