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

import com.microservices.common.core.web.domain.BaseEntity;
import com.microservices.zone.project.domain.ZoneProjectType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author otto
 */

@Data
@ApiModel("项目分类输入对象")
public class ZoneProjectTypeInputVo extends BaseEntity {
    @ApiModelProperty(value = "项目分类名称", required = true)
    @NotNull
    @Size(max = 30, message = "项目分类名称长度不能超过30个字符")
    private String name;
    @ApiModelProperty(value = "所属专区Id", required = true)
    @NotNull
    private Long zoneId;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    public ZoneProjectType toZoneProjectType() {
        ZoneProjectType zoneProjectType = new ZoneProjectType();
        zoneProjectType.setZoneId(zoneId);
        zoneProjectType.setName(name);
        zoneProjectType.setSort(sort);
        return zoneProjectType;
    }

}
