package easydo.technology.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import easydo.technology.base.CommonEntity;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotBlank;

/**
 * @author jinjin
 * @date 2020-09-25
 */
@Setter
@Getter
@TableName("sys_role")
public class Role extends CommonEntity {
    private static final long serialVersionUID = 1L;

    @TableId(value = "role_id", type = IdType.AUTO)
    private Long id;

    @NotBlank
    private String name;

    private Integer level;

    private String description;

    private String dataScope;

    public void copyFrom(Role source) {
        BeanUtils.copyProperties(source, this);
    }
}
