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 ZoneMemberInputVo {
    @ApiModelProperty(value = "gitlink用户Id", required = true)
    @NotNull
    private Long gitLinkUserId;
    @ApiModelProperty(value = "会员名称", required = true)
    @NotNull
    private String name;
    @ApiModelProperty(value = "会员头像", required = true)
    @NotNull
    private String imageUrl;
    @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 Boolean isSendInvitation;
    @ApiModelProperty(value = "所属专区", required = true)
    @NotNull
    private Long zoneId;
    @ApiModelProperty(value = "排序", hidden = true)
    private Integer sort;

    public ZoneMember toZoneMember() {
        ZoneMember zoneMember = new ZoneMember();
        zoneMember.setName(this.name);
        zoneMember.setImageUrl(this.imageUrl);
        zoneMember.setIntroduction(this.introduction);
        zoneMember.setMemberTypeId(this.memberTypeId);
        zoneMember.setMemberLevelId(this.memberLevelId);
        zoneMember.setZoneId(this.zoneId);
        zoneMember.setSort(this.sort);
        return zoneMember;
    }

}
