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 SysUserDeptRoleByUserInput {
    /**
     * 部门ID
     */
    @ApiModelProperty("部门ID")
    private Long deptId;

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

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