package com.microservices.system.domain.dto;

import com.microservices.system.api.domain.SysUserDeptRole;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @author otto
 */
@Data
@ApiModel("部门与用户及用户对应角色的关联输入对象")
public class SysUserDeptRoleByDeptInput {
    /**
     * 用户ID
     */
    @ApiModelProperty("用户ID")
    private Long userId;

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

    public SysUserDeptRole copyToSysUserDeptRole(Long deptId) {
        SysUserDeptRole sysUserDeptRole = new SysUserDeptRole();
        sysUserDeptRole.setDeptId(deptId);
        sysUserDeptRole.setUserId(this.getUserId());
        sysUserDeptRole.setRoleId(this.getRoleId());
        return sysUserDeptRole;
    }
}
