package sgc.portal.base.web;

import sgc.portal.base.service.ComBizDateService;
import sgc.portal.base.util.DateUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**
 * <pre>
 * 시스템명   : Common
 * 프로그램ID :
 * 프로그램명  :
 * 설명 :
 * </pre>
 *
 * @author 이범근
 * @version 2020.02.28
 * @since JDK1.8
 */
@RestController
@RequestMapping("/dateLib")
public class ComBizDateController {
    @Autowired
    private ComBizDateService comBizDateService;

    @RequestMapping(value = "/getBizDate", method = GET)
    public String getBizDate() {
        return comBizDateService.getBizDate();
    }

    @RequestMapping(value = "/getBizDate/{corpCd}", method = GET)
    public String getBizDate(@PathVariable String corpCd) {
        return comBizDateService.getBizDate(corpCd);
    }

    @RequestMapping(value = "/getServerDate", method = GET)
    public String getServerDate() {
        String dt = DateUtil.getTimeStamp();
        return dt;
    }
}
