package com.microservices.system.api.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;
/**
 * @author otto
 */
@ApiModel("用户与部门及部门对应角色的关联对象")
public class SysUserDeptRole {

    private static final long serialVersionUID = 1L;

    /**
     * 部门ID
     */
    @ApiModelProperty("部门ID")
    private Long deptId;

    /**
     * 用户ID
     */
    @ApiModelProperty("用户ID")
    private Long userId;

    /**
     * 角色ID
     */
    @ApiModelProperty("角色ID")
    private Long roleId;

    /**
     * 部门对象
     */
    @ApiModelProperty(value = "部门对象", hidden = true)
    private SysDept sysDept;
    /**
     * 用户对象
     */
    @ApiModelProperty(value = "用户对象", hidden = true)
    private SysUser sysUser;
    /**
     * 角色对象
     */
    @ApiModelProperty(value = "角色对象", hidden = true)
    private SysRole sysRole;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        SysUserDeptRole that = (SysUserDeptRole) o;
        return deptId.equals(that.deptId) && userId.equals(that.userId) && roleId.equals(that.roleId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deptId, userId, roleId);
    }

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public SysDept getSysDept() {
        return sysDept;
    }

    public void setSysDept(SysDept sysDept) {
        this.sysDept = sysDept;
    }

    public SysUser getSysUser() {
        return sysUser;
    }

    public void setSysUser(SysUser sysUser) {
        this.sysUser = sysUser;
    }

    public SysRole getSysRole() {
        return sysRole;
    }

    public void setSysRole(SysRole sysRole) {
        this.sysRole = sysRole;
    }

    @Override
    public String toString() {
        return "SysUserDeptRole{" +
                "deptId=" + deptId +
                ", userId=" + userId +
                ", roleId=" + roleId +
                ", sysDept=" + sysDept +
                ", sysUser=" + sysUser +
                ", sysRole=" + sysRole +
                '}';
    }
}
