package com.qxueyou.scc.msg.model;
|
|
import java.io.Serializable;
|
import java.util.Date;
|
|
import javax.persistence.Column;
|
import javax.persistence.GeneratedValue;
|
import javax.persistence.GenerationType;
|
import javax.persistence.Id;
|
|
|
/**
|
* 消息用户表 实体
|
* @author ody.yuan
|
*
|
*/
|
public class MsgChatroomMsg implements Serializable {
|
|
private static final long serialVersionUID = 1L;
|
|
/****0、正常消息,1、进入消息,2、退出消息,3、点赞消息,4、签到消息,5、抽奖消息(中奖名单),7、文档,8、赏,9、咨询***/
|
public static final int TYPE_NORMAL = 0, TYPE_ENTER = 1, TYPE_EXIT = 2, TYPE_PRAISE = 3, TYPE_LOTTERY = 4, TYPE_LOTTERY_RESULT = 5, TYPE_DOC = 7, TYPE_REWARD = 8, TYPE_CONSULT = 9;
|
|
/** 主键 */
|
@Id
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@Column(name="MSG_ID", unique=true, nullable=false, length=32)
|
private Long msgId;
|
|
/** 房间ID */
|
@Column(name="CHATROOM_ID")
|
private String chatroomId;
|
|
/** 消息类型 */
|
@Column(name="TYPE")
|
private Integer type;
|
|
/** 消息内容 */
|
@Column(name="CONTENT")
|
private String content;
|
|
/** 创建者ID */
|
@Column(name="SENDER_ID", length=32)
|
private String senderId;
|
|
/** 发送者昵称 */
|
@Column(name="ALIAS")
|
private String alias;
|
|
/** 发送者头像 */
|
@Column(name="IMG_PATH")
|
private String imgPath;
|
|
/** 创建时间 */
|
@Column(name="CREATE_TIME")
|
private Date createTime;
|
|
public static final String USER_TYPE_TEACHER = "1";
|
|
public static final String USER_TYPE_USER = "0";
|
|
/** 用户类型 */
|
@Column(name="USER_TYPE")
|
private String userType;
|
|
public Long getMsgId() {
|
return msgId;
|
}
|
|
public void setMsgId(Long msgId) {
|
this.msgId = msgId;
|
}
|
|
public String getChatroomId() {
|
return chatroomId;
|
}
|
|
public void setChatroomId(String chatroomId) {
|
this.chatroomId = chatroomId;
|
}
|
|
public Integer getType() {
|
return type;
|
}
|
|
public void setType(Integer type) {
|
this.type = type;
|
}
|
|
public String getContent() {
|
return content;
|
}
|
|
public void setContent(String content) {
|
this.content = content;
|
}
|
|
public String getSenderId() {
|
return senderId;
|
}
|
|
public void setSenderId(String senderId) {
|
this.senderId = senderId;
|
}
|
|
public String getAlias() {
|
return alias;
|
}
|
|
public void setAlias(String alias) {
|
this.alias = alias;
|
}
|
|
public String getImgPath() {
|
return imgPath;
|
}
|
|
public void setImgPath(String imgPath) {
|
this.imgPath = imgPath;
|
}
|
|
public Date getCreateTime() {
|
return createTime;
|
}
|
|
public void setCreateTime(Date createTime) {
|
this.createTime = createTime;
|
}
|
|
public String getUserType() {
|
return userType;
|
}
|
|
public void setUserType(String userType) {
|
this.userType = userType;
|
}
|
|
@Override
|
public int hashCode() {
|
final int prime = 31;
|
int result = 1;
|
result = prime * result + ((chatroomId == null) ? 0 : chatroomId.hashCode());
|
result = prime * result + ((senderId == null) ? 0 : senderId.hashCode());
|
result = prime * result + ((type == null) ? 0 : type.hashCode());
|
return result;
|
}
|
|
@Override
|
public boolean equals(Object obj) {
|
if (this == obj){
|
return true;
|
}
|
if (obj == null){
|
return false;
|
}
|
if (getClass() != obj.getClass()){
|
return false;
|
}
|
MsgChatroomMsg other = (MsgChatroomMsg) obj;
|
if (chatroomId == null) {
|
if (other.chatroomId != null){
|
return false;
|
}
|
} else if (!chatroomId.equals(other.chatroomId)){
|
return false;
|
}
|
if (senderId == null) {
|
if (other.senderId != null){
|
return false;
|
}
|
} else if (!senderId.equals(other.senderId)){
|
return false;
|
}
|
if (type == null) {
|
if (other.type != null){
|
return false;
|
}
|
} else if (!type.equals(other.type)){
|
return false;
|
}
|
return true;
|
}
|
|
}
|