package com.reptileclient.jlifeapp.web;

import com.reptileclient.jlifeapp.service.HmSalesOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(value = "银联商交易及销售数据抓取", description = "银联商交易及销售数据抓取")
public class HmSalesOrderController {

	private static final Logger logger = LoggerFactory.getLogger(HmSalesOrderController.class);

	@Autowired
	HmSalesOrderService hmSalesOrderService;

	/**
	 * 测抓数据
	 * 
	 * @return
	 */
	@ApiOperation(value = "银联商交易及销售数据抓取\"2020-11-28\", \"2020-12-01\"", notes = "\"2020-11-28\", \"2020-12-01\"")
	@GetMapping("runTes")
	public String runTes(String startDate, String endDate) {

		new Thread() {
			public void run() {
				hmSalesOrderService.fetchingData(startDate, endDate);
			};
		}.start();

		return "ok";
	}

}