package ru.micord.ervu_dashboard.controller;

import org.springframework.web.bind.annotation.RequestHeader;
import ru.micord.ervu_dashboard.service.DataDateService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Alexandr Shalaginov
 */
@RestController
public class DataDateController {

  private final DataDateService dataDateService;

  public DataDateController(DataDateService dataDateService) {
    this.dataDateService = dataDateService;
  }

  @GetMapping("/data-date")
  public String getDataDate(@RequestHeader("Client-Time-Zone") String clientTimeZone) {
    return dataDateService.getDataDate(clientTimeZone);
  }
}
