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 ZoneProjectTypeUpdateVo extends BaseEntity {
    @ApiModelProperty(value = "项目分类主键", required = true)
    @NotNull
    private Long id;
    @Size(max = 30, message = "项目分类名称长度不能超过30个字符")
    @ApiModelProperty(value = "项目分类名称", required = true)
    @NotNull
    private String name;

    @ApiModelProperty(value = "顺序")
    private Integer order;

    public ZoneProjectType toZoneProjectType() {
        ZoneProjectType zoneProjectType = new ZoneProjectType();
        zoneProjectType.setId(id);
        zoneProjectType.setName(name);
        return zoneProjectType;
    }

}
