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

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

import javax.validation.constraints.NotNull;

/**
 * @author otto
 */

@Data
@ApiModel("会员聚合初始化对象")
public class ZoneMemberInitVo {
    @ApiModelProperty(value = "gitlink用户名", required = true)
    @NotNull
    private String gitLinkUserName;
    @ApiModelProperty(value = "会员介绍")
    private String introduction;
    @ApiModelProperty(value = "专区会员类型", required = true)
    @NotNull
    private Long memberTypeId;
    @ApiModelProperty(value = "专区会员身份", required = true)
    @NotNull
    private Long memberLevelId;
    @ApiModelProperty(value = "所属专区", required = true)
    @NotNull
    private Long zoneId;

    public ZoneMember toZoneMember() {
        ZoneMember zoneMember = new ZoneMember();
        zoneMember.setIntroduction(this.introduction);
        zoneMember.setMemberTypeId(this.memberTypeId);
        zoneMember.setMemberLevelId(this.memberLevelId);
        zoneMember.setZoneId(this.zoneId);
        return zoneMember;
    }

}
