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

import com.microservices.common.core.utils.bean.BeanUtils;
import com.microservices.zone.resource.domain.ZoneResource;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author otto
 */

@Data
@ApiModel("资源输入对象")
public class ZoneResourceInputVo {
    @ApiModelProperty(value = "资源名称", required = true)
    @NotNull
    private String name;

    @ApiModelProperty(value = "审核状态（0：待审核，1：审核通过 2：审核不通过）", hidden = true)
    private String auditStatus = "1";
    @ApiModelProperty(value = "资源简介")
    private String summary;
    @ApiModelProperty(value = "资源领域Id", required = true)
    @NotNull
    private Long domainId;
    @ApiModelProperty(value = "资源文件Id列表")
    private String fileIds;
    @ApiModelProperty(value = "所属专区", required = true)
    @NotNull
    private Long zoneId;

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