ChatMessage.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.zksy.domain;
  2. import com.baomidou.mybatisplus.annotation.IdType;
  3. import com.baomidou.mybatisplus.annotation.TableField;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import com.baomidou.mybatisplus.annotation.TableName;
  6. import java.io.Serializable;
  7. import java.time.LocalDateTime;
  8. import lombok.Data;
  9. /**
  10. *
  11. * @TableName chat_message
  12. */
  13. @TableName(value ="chat_message")
  14. @Data
  15. public class ChatMessage implements Serializable {
  16. /**
  17. * 消息ID
  18. */
  19. @TableId(type = IdType.AUTO)
  20. private Long id;
  21. /**
  22. * 所属会话ID
  23. */
  24. private Long sessionId;
  25. /**
  26. * 发送者ID
  27. */
  28. private String fromId;
  29. /**
  30. * 发送者角色
  31. */
  32. private Object fromRole;
  33. /**
  34. * 接收者ID(单聊场景用)
  35. */
  36. private String toId;
  37. /**
  38. * 消息类型
  39. */
  40. private Object msgType;
  41. /**
  42. * 消息内容(JSON 或纯文本)
  43. */
  44. private String content;
  45. /**
  46. * 消息状态
  47. */
  48. private Object status;
  49. /**
  50. * 发送时间
  51. */
  52. private LocalDateTime createdAt;
  53. @TableField(exist = false)
  54. private static final long serialVersionUID = 1L;
  55. }