public Response queryDashboardPublishArticleStatisticsInfo() {
int currYear = LocalDate.now().getYear();
LocalDate firstDayOfYear = LocalDate.of(currYear, 1, 1);
String firstDayStr = firstDayOfYear.format(Constants.DATE_TIME_FORMATTER);
String currDayStr = LocalDate.now().format(Constants.DATE_TIME_FORMATTER);
List<ArticleCountDO> articleCountDOS = articleDao.selectArticleCount(firstDayStr, currDayStr);
Map<String, Long> map = null;
if (!CollectionUtils.isEmpty(articleCountDOS)) {
Map<String, Long> dateCountMap = articleCountDOS.stream().collect(Collectors.toMap(ArticleCountDO::getDate, ArticleCountDO::getCount));
map = Maps.newLinkedHashMap();
LocalDate currDate = LocalDate.now();
for (LocalDate date = firstDayOfYear; date.isBefore(currDate) || date.isEqual(currDate); date.plusDays(1)) {
String key = date.format(Constants.DATE_TIME_FORMATTER);
map.put(key, Objects.isNull(dateCountMap.get(key)) ? 0L : dateCountMap.get(key));
date = date.plusDays(1);
}
}
return Response.success(map);
}