94 lines
18 KiB
SQL
94 lines
18 KiB
SQL
-- ============================================================================
|
|
-- 初始化字典数据
|
|
-- 包括:星座数据、MBTI人格类型数据
|
|
-- ============================================================================
|
|
|
|
-- 使用emotion_museum数据库
|
|
USE emotion_museum;
|
|
|
|
-- 设置时间格式
|
|
SET time_zone = '+00:00';
|
|
|
|
-- ============================================================================
|
|
-- 1. 星座数据初始化
|
|
-- ============================================================================
|
|
INSERT INTO t_dictionary (
|
|
id, dict_type, dict_code, dict_name, dict_value, sort_order, status,
|
|
create_by, create_time, update_by, update_time, is_deleted, remarks
|
|
) VALUES
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'aries', '白羊座', '白羊座', 1, 1, 'system', NOW(), 'system', NOW(), 0, '白羊座 (3月21日-4月19日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'taurus', '金牛座', '金牛座', 2, 1, 'system', NOW(), 'system', NOW(), 0, '金牛座 (4月20日-5月20日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'gemini', '双子座', '双子座', 3, 1, 'system', NOW(), 'system', NOW(), 0, '双子座 (5月21日-6月21日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'cancer', '巨蟹座', '巨蟹座', 4, 1, 'system', NOW(), 'system', NOW(), 0, '巨蟹座 (6月22日-7月22日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'leo', '狮子座', '狮子座', 5, 1, 'system', NOW(), 'system', NOW(), 0, '狮子座 (7月23日-8月22日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'virgo', '处女座', '处女座', 6, 1, 'system', NOW(), 'system', NOW(), 0, '处女座 (8月23日-9月22日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'libra', '天秤座', '天秤座', 7, 1, 'system', NOW(), 'system', NOW(), 0, '天秤座 (9月23日-10月23日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'scorpio', '天蝎座', '天蝎座', 8, 1, 'system', NOW(), 'system', NOW(), 0, '天蝎座 (10月24日-11月22日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'sagittarius', '射手座', '射手座', 9, 1, 'system', NOW(), 'system', NOW(), 0, '射手座 (11月23日-12月21日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'capricorn', '摩羯座', '摩羯座', 10, 1, 'system', NOW(), 'system', NOW(), 0, '摩羯座 (12月22日-1月19日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'aquarius', '水瓶座', '水瓶座', 11, 1, 'system', NOW(), 'system', NOW(), 0, '水瓶座 (1月20日-2月18日)'),
|
|
(REPLACE(UUID(), '-', ''), 'constellation', 'pisces', '双鱼座', '双鱼座', 12, 1, 'system', NOW(), 'system', NOW(), 0, '双鱼座 (2月19日-3月20日)');
|
|
|
|
-- ============================================================================
|
|
-- 2. MBTI人格类型数据初始化
|
|
-- ============================================================================
|
|
INSERT INTO t_dictionary (
|
|
id, dict_type, dict_code, dict_name, dict_value, sort_order, status,
|
|
create_by, create_time, update_by, update_time, is_deleted, remarks
|
|
) VALUES
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'istj', 'ISTJ', 'ISTJ-检查员型', 1, 1, 'system', NOW(), 'system', NOW(), 0, '内倾感觉思维判断 - 一丝不苟的检查者'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'isfj', 'ISFJ', 'ISFJ-照顾者型', 2, 1, 'system', NOW(), 'system', NOW(), 0, '内倾感觉情感判断 - 忠诚的照顾者'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'infj', 'INFJ', 'INFJ-博爱型', 3, 1, 'system', NOW(), 'system', NOW(), 0, '内倾直觉情感判断 - 富有洞察力的博爱者'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'intj', 'INTJ', 'INTJ-专家型', 4, 1, 'system', NOW(), 'system', NOW(), 0, '内倾直觉思维判断 - 独立的战略家'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'istp', 'ISTP', 'ISTP-冒险家型', 5, 1, 'system', NOW(), 'system', NOW(), 0, '内倾感觉思维知觉 - 灵活的问题解决者'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'isfp', 'ISFP', 'ISFP-艺术家型', 6, 1, 'system', NOW(), 'system', NOW(), 0, '内倾感觉情感知觉 - 敏感的艺术家'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'infp', 'INFP', 'INFP-哲学家型', 7, 1, 'system', NOW(), 'system', NOW(), 0, '内倾直觉情感知觉 - 理想主义的哲学家'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'intp', 'INTP', 'INTP-学者型', 8, 1, 'system', NOW(), 'system', NOW(), 0, '内倾直觉思维知觉 - 好奇的分析师'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'estp', 'ESTP', 'ESTP-挑战者型', 9, 1, 'system', NOW(), 'system', NOW(), 0, '外倾感觉思维知觉 - 大胆的冒险者'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'esfp', 'ESFP', 'ESFP-表演者型', 10, 1, 'system', NOW(), 'system', NOW(), 0, '外倾感觉情感知觉 - 热情的表演者'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'enfp', 'ENFP', 'ENFP-公关型', 11, 1, 'system', NOW(), 'system', NOW(), 0, '外倾直觉情感知觉 - 充满热情的社交家'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'entp', 'ENTP', 'ENTP-智多星型', 12, 1, 'system', NOW(), 'system', NOW(), 0, '外倾直觉思维知觉 - 机智的辩论家'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'estj', 'ESTJ', 'ESTJ-管家型', 13, 1, 'system', NOW(), 'system', NOW(), 0, '外倾感觉思维判断 - 高效的组织者'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'esfj', 'ESFJ', 'ESFJ-主人型', 14, 1, 'system', NOW(), 'system', NOW(), 0, '外倾感觉情感判断 - 热情的主人'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'enfj', 'ENFJ', 'ENFJ-教导型', 15, 1, 'system', NOW(), 'system', NOW(), 0, '外倾直觉情感判断 - 鼓舞人心的领导者'),
|
|
(REPLACE(UUID(), '-', ''), 'mbti', 'entj', 'ENTJ', 'ENTJ-统帅型', 16, 1, 'system', NOW(), 'system', NOW(), 0, '外倾直觉思维判断 - 果断的指挥官');
|
|
|
|
-- ============================================================================
|
|
-- 3. 性别数据初始化
|
|
-- ============================================================================
|
|
INSERT INTO t_dictionary (
|
|
id, dict_type, dict_code, dict_name, dict_value, sort_order, status,
|
|
create_by, create_time, update_by, update_time, is_deleted, remarks
|
|
) VALUES
|
|
(REPLACE(UUID(), '-', ''), 'gender', 'male', '男', '男', 1, 1, 'system', NOW(), 'system', NOW(), 0, '性别:男'),
|
|
(REPLACE(UUID(), '-', ''), 'gender', 'female', '女', '女', 2, 1, 'system', NOW(), 'system', NOW(), 0, '性别:女'),
|
|
(REPLACE(UUID(), '-', ''), 'gender', 'secret', '保密', '保密', 3, 1, 'system', NOW(), 'system', NOW(), 0, '性别:保密'),
|
|
(REPLACE(UUID(), '-', ''), 'gender', 'other', '其他', '其他', 4, 1, 'system', NOW(), 'system', NOW(), 0, '性别:其他');
|
|
|
|
-- ============================================================================
|
|
-- 初始化完成
|
|
-- ============================================================================
|
|
COMMIT;
|
|
|
|
SELECT '字典数据初始化完成' AS result;
|
|
|
|
-- AI接口配置初始化脚本
|
|
INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('3d895ae5b3ea11f0a59104d4c4548e0b', 'Coze开发环境测试配置', 'coze.chat.development', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', 'v3', null, '7523042446285439016', '7523047462895796287', 10000, 2, 500, 2000, 0.80, 1.00, 1, 1, 0, 0, 'chat', 80, 0.000500, 0.001000, 'USD', 120, 7200, 172800, 1, 0, 'development', '{"Content-Type": "application/json"}', '{"parameters": {}}', null, null, 5, 'Coze平台开发环境测试配置,用于开发和调试', '1. 开发环境专用配置
|
|
2. 较短的超时时间和更高的请求限制
|
|
3. 用于功能测试和调试', null, '2025-10-28 18:38:28', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 18:52:50', 1, null, null, null, null);
|
|
INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('3d5cfb03b3ea11f0a59104d4c4548e0b', 'Coze聊天', 'coze.chat.default', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '7523042446285439016', '7585860129955528710', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 1, 0, 0, 'chat', 100, 0.001000, 0.002000, 'USD', 60, 3600, 86400, 1, 1, 'production', '{"Content-Type": "application/json"}', '{"parameters": {"input": "今天心情非常不好", "user_id": "19928748688"}}', '', '', 5, 'Coze平台的默认聊天机器人配置,用于日常情绪对话', '1. 需要配置有效的API Token
|
|
2. 需要配置Bot ID和Workflow ID
|
|
3. 支持流式输出和函数调用', null, '2025-10-28 18:38:28', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:03:39', 0, null, '', '', '');
|
|
INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('261808289317130240', 'Coze人生剧本生成', 'coze.course.life.generate', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '7523042446285439016', '7586262962160762926', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 0, 0, 0, 'content_generation', 0, 0.000000, 0.000000, 'USD', 60, 3600, 86400, 1, 0, 'production', '{}', '{"bot_id": "7523042446285439016", "parameters": {"input": "成为超级大富翁", "user_id": "19928748688"}, "workflow_id": "7586262962160762926"}', '', '', 5, '', '', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 18:52:40', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:10:29', 0, null, '', '', '');
|
|
INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('261823800167895040', 'Coze日记总结', 'coze.user.dairy.summary', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '7529062814150295595', '7586224423528251402', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 0, 0, 0, 'chat', 0, 0.000000, 0.000000, 'USD', 60, 3600, 86400, 1, 0, 'production', '{"Content-Type": "application/json"}', '{"parameters": {"input": "今天心情非常不好", "user_id": "19928748688"}}', '', '', 5, '', '', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:54:18', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:54:18', 0, null, '', '', '');
|
|
INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('261824790673756160', 'Coze用户故事', 'coze.user.chose.story', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '', '7585870811114766387', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 0, 0, 0, 'content_generation', 0, 0.000000, 0.000000, 'USD', 60, 3600, 86400, 1, 0, 'production', '{}', '{"parameters": {"input": "今天心情非常不好", "user_id": "19928748688"}, "workflow_id": "7585870811114766387"}', '', '', 5, '', '', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:58:15', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 19:58:15', 0, null, '', '', '');
|
|
INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('261825352626606080', 'Coze用户状态分析', 'coze.user.life.state', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', '', '', '', '7585860129955528710', 30000, 3, 1000, 4000, 0.70, 1.00, 1, 0, 0, 0, 'chat', 0, 0.000000, 0.000000, 'USD', 60, 3600, 86400, 1, 0, 'production', '{}', '{"parameters": {"input": "今天心情非常不好", "user_id": "19928748688"}, "workflow_id": "7585860129955528710"}', '', '', 5, '', '', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 20:00:29', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 20:00:29', 0, null, '', '', '');
|
|
INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('3d7898a2b3ea11f0a59104d4c4548e0b', 'Coze情绪分析配置', 'coze.emotion_analysis.default', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', 'v3', null, '7529062814150295595', '7523047462895796287', 45000, 3, 1500, 6000, 0.20, 1.00, 0, 1, 0, 0, 'emotion_analysis', 95, 0.001000, 0.002000, 'USD', 20, 1200, 28800, 1, 1, 'production', null, null, null, null, 5, 'Coze平台的情绪分析配置,用于分析用户聊天记录的情绪状态', '1. 使用最低的temperature以获得准确的情绪分析
|
|
2. 支持函数调用以获取结构化的分析结果
|
|
3. 增加超时时间以处理复杂的情绪分析', null, '2025-10-28 18:38:28', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 20:04:28', 1, null, null, null, null);
|
|
INSERT INTO emotion_museum.t_ai_config (id, config_name, config_key, config_type, provider, api_base_url, api_token, api_version, model_name, bot_id, workflow_id, timeout_ms, retry_count, retry_delay_ms, max_tokens, temperature, top_p, support_stream, support_function_call, support_vision, support_file_upload, usage_scenario, priority, input_price_per_1k, output_price_per_1k, currency, rate_limit_per_minute, rate_limit_per_hour, rate_limit_per_day, is_enabled, is_default, environment, custom_headers, custom_params, webhook_url, health_check_url, health_check_interval_minutes, description, usage_notes, create_by, create_time, update_by, update_time, is_deleted, remarks, client_id, client_secret, grant_type) VALUES ('3d6be3b6b3ea11f0a59104d4c4548e0b', 'Coze对话总结配置', 'coze.summary.default', 'coze', 'coze', 'https://api.coze.cn/v1/workflow/stream_run', 'sat_or7exwGUw4FtwOCakp5e9vhnPJpIQBMjv8XofyMqdmA2LMiJ3jC900dLAaZ7hdjd', 'v3', null, '7529062814150295595', '7523047462895796287', 30000, 3, 1000, 8000, 0.30, 1.00, 0, 0, 0, 0, 'summary', 90, 0.001000, 0.002000, 'USD', 30, 1800, 43200, 1, 1, 'production', null, null, null, null, 5, 'Coze平台的对话总结配置,专门用于生成对话摘要和情绪分析', '1. 使用较低的temperature以获得更稳定的总结结果
|
|
2. 增加max_tokens以支持长文本总结
|
|
3. 不支持流式输出', null, '2025-10-28 18:38:28', 'adce16b80c81fa25b7aa13a050f822cc', '2025-12-23 20:04:31', 1, null, null, null, null);
|
|
|
|
|