package com.ruoyi.project.task;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.service.ITrsSiteUpdateService;
import com.ruoyi.project.service.ITrsSiteconfigService;
import com.ruoyi.project.service.TrsWordSyncClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("trsTask")
public class TrsTask
{
    @Autowired
    private ITrsSiteconfigService trsSiteconfigService;

    @Autowired
    private ITrsSiteUpdateService trsSiteUpdateService;

    @Autowired
    private TrsWordSyncClientService trssWordSyncClientService;


    public void trsMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
    {
        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    public void trsParams(String params)
    {
        System.out.println("执行有参方法：" + params);
        String[] split = params.split(";");
        trsSiteconfigService.doscan(Long.parseLong(split[0]), split[1], split[2]);
    }

    public void trsurl(String params)
    {
        System.out.println("执行有参方法：" + params);
        trsSiteconfigService.docon(Long.parseLong(params));

    }

    public void trsNoParams()
    {
        System.out.println("TRS执行无参方法");
    }

    public void trsMonitor(String params)
    {
        System.out.println("执行周期扫描方法：" + params);
        trsSiteUpdateService.doMonitorInsert();
    }

    public void trsWordSyn(String params)
    {
        System.out.println("TRS执行同步词库同步接口");
        trssWordSyncClientService.syncWords(params);
    }

}
