5.3 KiB
5.3 KiB
https://x.com/Crypto_QianXun/status/2000824222298595627?s=20
PrivateKey: aDimi0YKf6l9S-tfu1Vpncrach9DxR5th3DppwbexFo Password: CWNO5lIeiJM7cRXvrXVyR8053GKMdGhjDc-HO9MVvEU Hash32: L8jSjxhDWlpHAcV30OGI4G3S__jqEnWQJv2opKp4BKs 6e48eb91-d3ef-421d-b676-3a115b30e3fe
510000: "socks5://colauser-sichuan-chengdu:dJ31$lCohDouAI@110.185.110.244:11235"
440000: "socks5://colauser-guangdong-dongguan:lH7dsHH9g&jM@121.14.153.133:11235"
CREATE TABLE `auto_learn_setting`
(
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`ent_id` int(11) NOT NULL COMMENT '企业id',
`enabled` bool NOT NULL DEFAULT true comment '是否启用',
`source` varchar(255) NOT NULL DEFAULT '' COMMENT '渠道',
`sub_source` varchar(255) NOT NULL DEFAULT '' COMMENT '子渠道来源',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '标题名称',
`updated_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间',
`created_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_ent` (`ent_id`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='自动学习设置'
CREATE TABLE `new_meiqia`.`auth_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '认证信息id',
`phone` varchar(50) NOT NULL COMMENT '手机号',
`password` varchar(200) NOT NULL DEFAULT '' COMMENT '密码',
`created_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
`updated_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间',
`deleted_at` datetime(6) DEFAULT NULL COMMENT '软删除时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_phone_del` (`phone`, `deleted_at`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '认证信息表';
CREATE TABLE `new_meiqia`.`auth_info_agent` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`auth_info_id` int(11) NOT NULL COMMENT '认证信息id',
`agent_id` int(11) NOT NULL COMMENT '客服id',
`created_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_auth_agent` (`auth_info_id`, `agent_id`),
KEY `idx_agent` (`agent_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '认证信息与客服关联表';
CREATE TABLE `user_login_status` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`agent_id` BIGINT NOT NULL,
`platform` VARCHAR(32) NOT NULL COMMENT 'web, ios, android, mac, windows等',
`token` VARCHAR(128) NOT NULL COMMENT '登录token',
`user_agent` VARCHAR(512) DEFAULT NULL,
`ip` VARCHAR(64) DEFAULT NULL,
`isp` VARCHAR(64) DEFAULT NULL,
`country` VARCHAR(64) DEFAULT NULL,
`province` VARCHAR(64) DEFAULT NULL,
`city` VARCHAR(64) DEFAULT NULL,
`status` VARCHAR(32) NOT NULL COMMENT 'online(在线), invisible(隐身), off_duty(离线/登出)',
`login_at` DATETIME NOT NULL,
`device_name` VARCHAR(128) NOT NULL COMMENT '设备名',
`device_type` VARCHAR(128) NOT NULL COMMENT '设备类型',
`device_system` VARCHAR(128) NOT NULL COMMENT '设备系统',
`updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE INDEX `idx_token` (`token`),
INDEX `idx_agent_platform` (`agent_id`, `platform`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户登录状态表';
INSERT INTO auth_info (phone, password, created_at, updated_at)
SELECT DISTINCT
phone,
COALESCE(password, '') as password,
NOW(6),
NOW(6)
FROM agent
WHERE deleted_at IS NULL
AND phone IS NOT NULL
AND phone != ''
AND NOT EXISTS (
SELECT 1 FROM auth_info ai WHERE ai.phone = agent.phone AND ai.deleted_at IS NULL
)
GROUP BY phone;
-- 步骤2: 创建 auth_info 与 agent 的关联关系
INSERT INTO auth_info_agent (auth_info_id, agent_id, created_at)
SELECT
ai.id as auth_info_id,
a.id as agent_id,
NOW(6)
FROM agent a
INNER JOIN auth_info ai ON a.phone = ai.phone AND ai.deleted_at IS NULL
WHERE a.deleted_at IS NULL
AND a.phone IS NOT NULL
AND a.phone != ''
AND NOT EXISTS (
SELECT 1 FROM auth_info_agent aia
WHERE aia.auth_info_id = ai.id AND aia.agent_id = a.id
);
alter table smart_card
add map_content json not null comment '带映射的卡片内容' after contents;
alter table webhook
add workec_id int default 0 not null comment 'workec配置ID' after push_platform;
CREATE TABLE `new_meiqia`.`workec` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`ent_id` int(11) NOT NULL COMMENT '企业id',
`name` varchar(50) NOT NULL COMMENT '配置名称',
`app_id` varchar(128) NOT NULL COMMENT 'AppID',
`app_secret` varchar(256) NOT NULL COMMENT 'AppSecret',
`source_map` json COMMENT 'attr(string)和source(int)的映射关系',
`created_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) COMMENT '创建时间',
`updated_at` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_ent_id` (`ent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='workec配置';