refactor: reuse global aliyun moderation config
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
-- 阿里云文本审核统一复用 hg_sys_config.im_third_party 中的公共凭证、地域和端点。
|
||||
-- 可重复执行;清理 im_external_config 中历史重复保存的密钥和连接参数。
|
||||
|
||||
INSERT INTO `im_external_config`
|
||||
(`tenant_id`, `service`, `provider`, `endpoint`, `enabled`, `status`, `config_json`, `secret_json`, `created_by`, `updated_by`)
|
||||
SELECT
|
||||
t.`id`,
|
||||
'moderation',
|
||||
'aliyun_green',
|
||||
'',
|
||||
1,
|
||||
'unconfigured',
|
||||
JSON_OBJECT(
|
||||
'nickname_service', 'nickname_detection_pro',
|
||||
'chat_service', 'chat_detection_pro',
|
||||
'timeout_ms', 1500,
|
||||
'failure_mode', 'allow'
|
||||
),
|
||||
JSON_OBJECT(),
|
||||
0,
|
||||
0
|
||||
FROM `im_tenant` t
|
||||
WHERE t.`code` = 'default'
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`provider` = VALUES(`provider`),
|
||||
`endpoint` = VALUES(`endpoint`),
|
||||
`enabled` = VALUES(`enabled`),
|
||||
`status` = VALUES(`status`),
|
||||
`config_json` = VALUES(`config_json`),
|
||||
`secret_json` = VALUES(`secret_json`),
|
||||
`checked_at` = NULL,
|
||||
`check_result` = '',
|
||||
`updated_at` = CURRENT_TIMESTAMP;
|
||||
Reference in New Issue
Block a user