package com.huatek.busi.controller;

import java.util.Map;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.huatek.busi.service.TestTaskService;
import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil;

/**
 * 定时任务测试工具
 * 
 * @author anker_cheng
 * @date 2019/09/09
 */
@RestController
@RequestMapping("/api/testTask")
public class TestTaskController {
    @Reference(check = false)
    private TestTaskService testTaskService;

    @GetMapping(value = "/test")
    public Map<String, Object> testTask(@RequestParam("beanName") String beanName,
        @RequestParam(value = "date", required = false) String date) {
        testTaskService.doTest(beanName, date);
        return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", null);
    }
}
