You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chat-room/Message.java

114 lines
2.3 KiB

package com.hyc.wechat.model.po;
import com.alibaba.fastjson.annotation.JSONField;
import com.hyc.wechat.dao.annotation.Table;
import com.hyc.wechat.model.po.abs.BaseEntity;
import java.math.BigInteger;
import java.sql.Timestamp;
/**
* @author <a href="mailto:kobe524348@gmail.com">黄钰朝</a>
* @description 消息实体类,用于表示聊天消息的基本信息
* @date 2019-05-03 13:01
*/
@Table(name = "message") // 指定该实体类对应的数据库表名为"message"
public class Message extends BaseEntity {
// 发送者的ID
@JSONField(name = "sender_id")
private BigInteger senderId;
// 聊天室的ID
@JSONField(name = "chat_id")
private BigInteger chatId;
// 消息内容
private String content;
// 消息类型(如文本、图片、视频等)
private String type;
// 消息发送的时间
private Timestamp time;
/**
* 获取消息类型
* @return 消息类型
*/
public String getType() {
return type;
}
/**
* 设置消息类型
* @param type 消息类型
*/
public void setType(String type) {
this.type = type;
}
/**
* 获取消息发送时间
* @return 消息发送时间
*/
public Timestamp getTime() {
return time;
}
/**
* 设置消息发送时间
* @param time 消息发送时间
*/
public void setTime(Timestamp time) {
this.time = time;
}
/**
* 获取发送者ID
* @return 发送者ID
*/
public BigInteger getSenderId() {
return senderId;
}
/**
* 设置发送者ID
* @param senderId 发送者ID
*/
public void setSenderId(BigInteger senderId) {
this.senderId = senderId;
}
/**
* 获取聊天室ID
* @return 聊天室ID
*/
public BigInteger getChatId() {
return chatId;
}
/**
* 设置聊天室ID
* @param chatId 聊天室ID
*/
public void setChatId(BigInteger chatId) {
this.chatId = chatId;
}
/**
* 获取消息内容
* @return 消息内容
*/
public String getContent() {
return content;
}
/**
* 设置消息内容
* @param content 消息内容
*/
public void setContent(String content) {
this.content = content;
}
}