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

import com.microservices.zone.member.domain.ZoneMemberLevel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author otto
 */

@Data
@ApiModel("会员聚合身份输入对象")
public class ZoneMemberLevelInputVo {
    @ApiModelProperty(value = "专区会员身份名称", required = true)
    @NotNull
    private String name;
    @ApiModelProperty(value = "专区会员身份排序", required = true)
    @NotNull
    private Integer sort;
    @ApiModelProperty(value = "所属专区", required = true)
    @NotNull
    private Long zoneId;

    public ZoneMemberLevel toZoneMemberLevel() {
        ZoneMemberLevel zoneMemberLevel = new ZoneMemberLevel();
        zoneMemberLevel.setZoneId(zoneId);
        zoneMemberLevel.setSort(sort);
        zoneMemberLevel.setName(name);
        return zoneMemberLevel;
    }
}
