Files
012-kaopeilian/backend/insert_test_logs.sql
111 998211c483 feat: 初始化考培练系统项目
- 从服务器拉取完整代码
- 按框架规范整理项目结构
- 配置 Drone CI 测试环境部署
- 包含后端(FastAPI)、前端(Vue3)、管理端

技术栈: Vue3 + TypeScript + FastAPI + MySQL
2026-01-24 19:33:28 +08:00

28 lines
3.2 KiB
SQL
Raw Permalink 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.
-- 插入测试系统日志数据
INSERT INTO `system_logs` (`level`, `type`, `user`, `user_id`, `ip`, `message`, `user_agent`, `path`, `method`, `extra_data`)
VALUES
('info', 'system', 'system', NULL, NULL, '系统启动成功', NULL, NULL, NULL, NULL),
('info', 'user', 'admin', 1, '192.168.1.100', '管理员登录系统', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', '/api/v1/auth/login', 'POST', NULL),
('info', 'api', 'admin', 1, '192.168.1.100', '查询用户列表', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', '/api/v1/users', 'GET', NULL),
('warning', 'security', 'unknown', NULL, '192.168.1.200', '尝试访问未授权资源', 'Mozilla/5.0 (Macintosh; Intel Mac OS X)', '/api/v1/admin/users', 'GET', NULL),
('error', 'error', 'manager1', 2, '192.168.1.101', '数据库连接超时', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', '/api/v1/courses', 'GET', '{"error": "Connection timeout"}'),
('info', 'user', 'trainee1', 3, '192.168.1.102', '学员开始考试', 'Mozilla/5.0 (iPhone; CPU iPhone OS)', '/api/v1/exams/start', 'POST', NULL),
('info', 'user', 'trainee1', 3, '192.168.1.102', '学员提交考试答案', 'Mozilla/5.0 (iPhone; CPU iPhone OS)', '/api/v1/exams/submit', 'POST', NULL),
('warning', 'api', 'trainee2', 4, '192.168.1.103', 'API请求频率过高', 'Mozilla/5.0 (Android)', '/api/v1/courses', 'GET', '{"rate_limit": "exceeded"}'),
('error', 'error', 'system', NULL, NULL, '文件上传失败:磁盘空间不足', NULL, '/api/v1/upload', 'POST', '{"error": "Disk full"}'),
('info', 'system', 'system', NULL, NULL, '定时任务执行:清理过期数据', NULL, NULL, NULL, NULL),
('debug', 'api', 'admin', 1, '192.168.1.100', 'SQL查询: SELECT * FROM users', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', '/api/v1/users', 'GET', NULL),
('info', 'user', 'manager1', 2, '192.168.1.101', '创建新课程:《皮肤管理基础》', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', '/api/v1/courses', 'POST', NULL),
('error', 'security', 'hacker', NULL, '192.168.1.250', 'SQL注入攻击尝试被拦截', 'curl/7.68.0', '/api/v1/auth/login', 'POST', '{"blocked": true}'),
('warning', 'api', 'trainee3', 5, '192.168.1.104', 'API响应时间超过3秒', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', '/api/v1/practice/sessions', 'GET', '{"response_time": 3.2}'),
('info', 'user', 'admin', 1, '192.168.1.100', '批量导入学员数据成功50条', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', '/api/v1/admin/import', 'POST', NULL),
('info', 'system', 'system', NULL, NULL, '数据库备份完成', NULL, NULL, NULL, '{"backup_file": "backup_20241016.sql"}'),
('error', 'error', 'trainee4', 6, '192.168.1.105', '视频播放失败:资源不存在', 'Mozilla/5.0 (iPad; CPU OS)', '/api/v1/courses/1/video', 'GET', '{"error": "Resource not found"}'),
('info', 'user', 'manager1', 2, '192.168.1.101', '发布课程公告', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', '/api/v1/courses/1/announcements', 'POST', NULL),
('debug', 'api', 'system', NULL, NULL, '缓存刷新courses_list', NULL, '/internal/cache/refresh', 'POST', NULL),
('warning', 'security', 'unknown', NULL, '192.168.1.201', '密码错误超过5次账户已锁定', 'Mozilla/5.0 (Linux; Android)', '/api/v1/auth/login', 'POST', '{"locked": true, "user": "test@example.com"}');