-- ---------------------------------------------------------------- -- IM「联系我们」配置:字典管理新增 im_contact_us 字典类型及默认字典数据 -- 用途:移动端通过 im-server 接口 /v1/im/contact-us 读取展示客服邮箱 -- 依赖:无需前置 SQL -- 幂等:重复执行不产生重复行 -- 说明:邮箱的最终值请在管理后台「系统管理 → 字典管理 → 联系我们」中维护 -- ---------------------------------------------------------------- USE hotgo; SET @now := NOW(); -- 字典类型:联系我们(挂载在系统枚举 sys 下) INSERT INTO `hg_sys_dict_type` (`pid`, `name`, `type`, `sort`, `remark`, `status`, `created_at`, `updated_at`) SELECT (SELECT `id` FROM `hg_sys_dict_type` WHERE `type` = 'sys' LIMIT 1), '联系我们', 'im_contact_us', 0, '移动端联系我们配置', 1, @now, @now WHERE NOT EXISTS (SELECT 1 FROM `hg_sys_dict_type` WHERE `type` = 'im_contact_us'); -- 字典数据:客服邮箱 INSERT INTO `hg_sys_dict_data` (`label`, `value`, `value_type`, `type`, `list_class`, `is_default`, `sort`, `remark`, `status`, `created_at`, `updated_at`) SELECT '客服邮箱', 'support@example.com', 'string', 'im_contact_us', '', 1, 10, '移动端展示的客服邮箱', 1, @now, @now WHERE NOT EXISTS (SELECT 1 FROM `hg_sys_dict_data` WHERE `type` = 'im_contact_us' AND `label` = '客服邮箱');