Files
ruoyi-java/sql/wecom_inbound_trace.sql
2026-04-01 15:52:55 +08:00

34 lines
2.0 KiB
SQL
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.

-- 企业微信桥接消息追踪Jarvis 落库,供后台查看)
DROP TABLE IF EXISTS `wecom_inbound_trace`;
CREATE TABLE `wecom_inbound_trace` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`msg_id` varchar(64) DEFAULT NULL COMMENT '企微消息 MsgId',
`agent_id` varchar(32) DEFAULT NULL COMMENT '应用 AgentID',
`corp_id` varchar(64) DEFAULT NULL COMMENT '企业 CorpIdXML ToUserName',
`from_user_name` varchar(128) NOT NULL COMMENT '发送人成员 UserIDFromUserName',
`content` mediumtext COMMENT '用户发送内容',
`wx_msg_time` datetime DEFAULT NULL COMMENT '微信侧 CreateTime秒级时间戳转换',
`reply_content` mediumtext COMMENT 'Jarvis 返回给 wxSend 的回复文本',
`session_active` tinyint(4) NOT NULL DEFAULT 0 COMMENT '处理完成后是否存在多轮会话0否 1是',
`session_scene` varchar(64) DEFAULT NULL COMMENT '会话场景(如 JD_LOGISTICS_SHARE',
`session_step` varchar(64) DEFAULT NULL COMMENT '会话步骤(如 WAIT_REMARK',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '服务端接收处理时间',
PRIMARY KEY (`id`),
KEY `idx_from_user` (`from_user_name`),
KEY `idx_msg_id` (`msg_id`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='企微 inbound 消息追踪';
-- 菜单:挂在「系统监控」下,与日志文件类似;执行后请给需要角色分配该菜单权限
INSERT INTO sys_menu VALUES (
2090, '企微消息跟踪', 2, 8, 'wecomInboundTrace', 'jarvis/wecomInboundTrace/index', '', '', 1, 0, 'C', '0', '0',
'jarvis:wecom:inboundTrace:list', 'wechat', 'admin', sysdate(), '', NULL, '企微回调经 Jarvis 处理记录'
);
INSERT INTO sys_menu VALUES (
2092, '删除', 2090, 1, '', '', '', '', 1, 0, 'F', '0', '0',
'jarvis:wecom:inboundTrace:remove', '#', 'admin', sysdate(), '', NULL, ''
);
-- 若需超级管理员角色默认拥有role_id 按实际调整,常见管理员为 1
-- INSERT INTO sys_role_menu (role_id, menu_id) VALUES (1, 2090), (1, 2092);