package com.kiisoo.ic.job.behavior;
import	java.text.SimpleDateFormat;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/job")
@Slf4j
public class SyncBehaviorJobController {
    @Autowired
    private CustomerBehaviorJob customerBehaviorJob;

    @GetMapping("/sync/behavior")
    public void getCustomerInfo(@RequestParam("startDate") String startDate, @RequestParam("endDate")String endDate){
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            customerBehaviorJob.handle(sdf.parse(startDate),sdf.parse(endDate),null);
        }catch (Exception e){
            log.error("",e);
        }
    }
}
