mateclaw/mateclaw-server/src/main/java/vip/mate/channel/model/ChannelSessionEntity.java

62 lines
1.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package vip.mate.channel.model;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;
/**
* 渠道会话存储实体
* <p>
* 缓存各渠道的会话标识映射,用于主动推送场景。
* key 为 conversationId如 dingtalk:sw:xxx
* value 为平台推送所需的标识sessionWebhook / chat_id / channel_id
*
* @author MateClaw Team
*/
@Data
@TableName("mate_channel_session")
public class ChannelSessionEntity {
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/** 会话ID格式{channelType}:{identifier} */
private String conversationId;
/** 渠道类型 */
private String channelType;
/**
* 推送目标标识
* <p>
* 不同渠道含义不同:
* - 钉钉sessionWebhook URL 或 userId
* - 飞书chat_idoc_xxx或 open_idou_xxx
* - Telegramchat_id
* - Discordchannel_id
* - 企业微信userId
*/
private String targetId;
/** 发送者ID */
private String senderId;
/** 发送者名称 */
private String senderName;
/** 关联的渠道配置ID */
private Long channelId;
/** 最后活跃时间 */
private LocalDateTime lastActiveTime;
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
private Integer deleted;
}