package io.hmit.modules.fhjw.dto;

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

import java.io.Serializable;
import java.util.Date;


/**
 * 用户权限对应表
 *
 * @author zsh 408538940@qq.com
 * @since 1.0.0 2021-06-03
 */
@Data
@ApiModel(value = "用户权限对应表")
public class UserRoleDTO implements Serializable {
    private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "id")
	private Long id;

	@ApiModelProperty(value = "角色ID")
	private Long roleId;

	@ApiModelProperty(value = "用户ID")
	private Long userId;

	@ApiModelProperty(value = "创建者")
	private Long creator;

	@ApiModelProperty(value = "创建时间")
	private Date createDate;

	public UserRoleDTO assembleUserRole(Long roleId, Long userId) {
		UserRoleDTO userRole = new UserRoleDTO();
		userRole.setRoleId(roleId);
		userRole.setUserId(userId);
		userRole.setCreateDate(new Date());
		return userRole;
	}


}
