package com.microservices.system.domain.vo;

import com.microservices.common.core.utils.bean.BeanUtils;
import com.microservices.system.api.domain.SysRole;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @author otto
 */
@Data
@ApiModel("角色输入对象")
public class SysRoleInputVo {
    @ApiModelProperty(value = "角色名称")
    @NotBlank
    private String roleName;
    @ApiModelProperty(value = "角色排序")
    private Integer roleSort;
    @ApiModelProperty(value = "菜单组")
    @NotNull
    private Long[] menuIds;
    @ApiModelProperty(value = "角色描述")
    @Size(max = 300, message = "角色描述长度不能超过300个字符")
    private String remark;

    public SysRole toSysRole() {
        SysRole target = new SysRole();
        BeanUtils.copyProperties(this, target);
        return target;
    }
}
