Files
iotlcm/schema/08-seed-mock-channel.sql
T
MiFaZhan bc2c7bcc6b init: IotLCM 开源版部署仓
内容:
- docker-compose.yml:14 个基础/业务服务 + 3 个可选 profile(with-mock 挡板、with-bot、with-nginx)
- .env.example:集中管理镜像仓库、口令、端口;必填项缺失时 compose 直接报错退出
- config.example/:10 份配置模板,全部为占位值与注释说明
- schema/:12 个初始化脚本,按文件名顺序由 MySQL initdb 自动执行

脱敏处理:
- 生产/内网 IP、镜像仓库地址、公司名、真实域名全部清除
- 演示账号保留 18 个(出库与划拨依赖账号与部门树的关联),
  昵称/邮箱/手机号/登录IP/头像改为占位或编造值
- 数据库账号与 admin 口令改为初始化时按 .env 注入计算
- 通道模板与 Mock 通道的上游密钥置空
- Mock 通道地址指向 compose 内 onelink-mock 服务

部署时用 --profile with-mock 启动运营商接口挡板,即可在无真实运营商环境时跑通全链路。
2026-10-28 13:40:12 +08:00

53 lines
2.3 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.
-- ============================================
-- 演示环境种子数据:Mock 通道(2026-10-27)
-- 来源:旧演示机 .160 的 t_sim_channels(该库唯一一条通道记录)
--
-- 为什么必须有:
-- 种子库 01-schema.sql 只含 t_sim_channels 的建表语句、没有数据,
-- 但 t_sim_card_info(100 张) 与 t_sim_card_stock(50100 张) 的 chan_key
-- 全部指向 channel_yd_mock。通道缺失会让卡片管理页的通道列、按通道筛选、
-- 以及开卡/停复机等依赖通道的操作全部异常。
--
-- 上游走 Mock(http://onelink-mock:8080/),不消耗真实运营商流量。
--
-- 幂等:以 (tenant_id, chan_key) 唯一键做 ON DUPLICATE KEY UPDATE。
-- 执行顺序:08(在 01-07 之后)
-- ============================================
SET NAMES utf8mb4;
USE `db_iotlcm`;
INSERT INTO `t_sim_channels` (
`id`,`temp_key`,`chan_key`,`chan_name`,`chan_config`,`chan_status`,`share_enabled`,
`chan_alias`,`region_code`,`app_key`,`app_secret`,`access_token`,
`access_token_created`,`access_token_expire`,`refresh_token`,
`login_user`,`login_password`,`login_url`,`remark`,`tenant_id`,
`created_dept`,`created_by`,`created_at`,`updated_by`,`updated_at`,
`operator`,`is_normal`,`docking_status`,`sync_enabled`,
`card_info_count`,`stock_card_count`,`cancellation_card_count`
) VALUES (
34,'sim_yd_mock_v5','channel_yd_mock','移动模拟通道','{}',0,0,
'中国移动00',NULL,'100059999270000006','password123',NULL,
NULL,NULL,'',
NULL,NULL,'http://onelink-mock:8080/',NULL,'000000',
1,1,'2026-10-19 15:35:03',NULL,NOW(),
1,1,NULL,0,
100,50100,0
)
ON DUPLICATE KEY UPDATE
`temp_key` = VALUES(`temp_key`),
`chan_name` = VALUES(`chan_name`),
`chan_config` = VALUES(`chan_config`),
`chan_status` = VALUES(`chan_status`),
`chan_alias` = VALUES(`chan_alias`),
`app_key` = VALUES(`app_key`),
`app_secret` = VALUES(`app_secret`),
`login_url` = VALUES(`login_url`),
`operator` = VALUES(`operator`),
`is_normal` = VALUES(`is_normal`),
`sync_enabled` = VALUES(`sync_enabled`),
`updated_at` = VALUES(`updated_at`),
`card_info_count` = VALUES(`card_info_count`),
`stock_card_count` = VALUES(`stock_card_count`),
`cancellation_card_count` = VALUES(`cancellation_card_count`);