fix(console): parse dashboard backfill dates
This commit is contained in:
parent
ab515c122c
commit
3a65d1b46e
@ -17,7 +17,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -66,14 +65,16 @@ public class DatavRestController extends BaseController {
|
||||
|
||||
@PostMapping("/country-dashboard/backfill")
|
||||
public Map<String, Object> backfillCountryDashboard(
|
||||
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
|
||||
@RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate,
|
||||
@RequestParam String startDate,
|
||||
@RequestParam String endDate,
|
||||
@RequestParam(value = "sysOrigin", defaultValue = "LIKEI") String sysOrigin) {
|
||||
countryDashboardDailyMetricService.refreshRange(startDate, endDate, sysOrigin);
|
||||
LocalDate parsedStartDate = LocalDate.parse(startDate);
|
||||
LocalDate parsedEndDate = LocalDate.parse(endDate);
|
||||
countryDashboardDailyMetricService.refreshRange(parsedStartDate, parsedEndDate, sysOrigin);
|
||||
return Map.of(
|
||||
"status", "success",
|
||||
"startDate", startDate.toString(),
|
||||
"endDate", endDate.toString(),
|
||||
"startDate", parsedStartDate.toString(),
|
||||
"endDate", parsedEndDate.toString(),
|
||||
"sysOrigin", sysOrigin);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user