package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "tsm_worker_role")
@NamedQuery(name = "TsmWorkerRole.findAll", query="SELECT t FROM TsmWorkerRole t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of= {"id"})
@GenericGenerator(name = "idGenerator", strategy = "com.crunii.micro.core.distributed.DistributedSnowFlakeId")
@ApiModel(description = "员工对应角色表")
public class TsmWorkerRole  implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "id")
	@ApiModelProperty(value = "主键")
	private Long id;

	@Column(name = "login_id")
	@ApiModelProperty(value = "工号id")
	private int loginId;

	@Column(name = "role_id")
	@ApiModelProperty(value = "角色id")
	private int roleId;

	@Column(name = "source")
	@ApiModelProperty(value = "来源(1用户管理,2职务管理)")
	private int source;

}
