-- ====================================================
-- 定时任务元数据初始化脚本
-- ====================================================

-- 插入人民日报新闻爬取任务的元数据

-- 1. 关键字搜索爬取
INSERT INTO `tb_crontab_task_meta` (
    `id`, `meta_id`, `name`, `description`, `category`, 
    `bean_name`, `method_name`, `script_path`, `param_schema`, 
    `sort_order`, `creator`, `create_time`
) VALUES (
    '1', 
    'rmbr_keyword_search', 
    '关键字搜索爬取', 
    '根据关键字搜索人民日报新闻内容', 
    '人民日报新闻爬取',
    'newsCrewerTask', 
    'execute', 
    'crawler/RmrbSearch.py',
    '[
        {
            "name": "query",
            "description": "搜索关键字",
            "type": "String",
            "value": "",
            "required": true
        },
        {
            "name": "total",
            "description": "总新闻数量",
            "type": "Integer",
            "value": 10,
            "required": true
        }
    ]',
    1,
    'system',
    NOW()
);

-- 2. 排行榜爬取
INSERT INTO `tb_crontab_task_meta` (
    `id`, `meta_id`, `name`, `description`, `category`, 
    `bean_name`, `method_name`, `script_path`, `param_schema`, 
    `sort_order`, `creator`, `create_time`
) VALUES (
    '2', 
    'rmbr_hotpoint', 
    '排行榜爬取', 
    '爬取人民日报热门排行榜新闻', 
    '人民日报新闻爬取',
    'newsCrewerTask', 
    'execute', 
    'crawler/RmrbHotPoint.py',
    '[]',
    2,
    'system',
    NOW()
);

-- 3. 往日精彩头条爬取
INSERT INTO `tb_crontab_task_meta` (
    `id`, `meta_id`, `name`, `description`, `category`, 
    `bean_name`, `method_name`, `script_path`, `param_schema`, 
    `sort_order`, `creator`, `create_time`
) VALUES (
    '3', 
    'rmbr_trending', 
    '往日精彩头条爬取', 
    '爬取人民日报往日精彩头条新闻', 
    '人民日报新闻爬取',
    'newsCrewerTask', 
    'execute', 
    'crawler/RmrbTrending.py',
    '[
        {
            "name": "startDate",
            "description": "开始日期",
            "type": "String",
            "value": "",
            "required": false
        },
        {
            "name": "endDate",
            "description": "结束日期",
            "type": "String",
            "value": "",
            "required": false
        },
        {
            "name": "yesterday",
            "description": "是否是昨天",
            "type": "Boolean",
            "value": true,
            "required": false
        }
    ]',
    3,
    'system',
    NOW()
);