修改返回数组类型

This commit is contained in:
wanggeng 2021-07-27 11:18:09 +08:00
parent 005b775a7c
commit cce3d084a4

View File

@ -88,13 +88,12 @@ public class CountServiceImpl extends DefaultBaseService implements ICountServic
public Map<String, Object> countLoginForDays(Integer days) { public Map<String, Object> countLoginForDays(Integer days) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateTimeFormatter dayDateTimeFormatter = DateTimeFormat.forPattern(DAY_FORMATTER); DateTimeFormatter dayDateTimeFormatter = DateTimeFormat.forPattern(DAY_FORMATTER);
String[] dateArray = new String[days]; List<String> dateArray = new ArrayList<>();
Integer[] loginCountArray = new Integer[days]; List<String> loginCountArray = new ArrayList<>();
for (int i = days - 1; i >= 0; i--) { for (int i = days - 1; i >= 0; i--) {
String currentDay = now.minusDays(i).toString(dayDateTimeFormatter); String currentDay = now.minusDays(i).toString(dayDateTimeFormatter);
int index = days - (i + 1); dateArray.add(currentDay);
dateArray[index] = currentDay; loginCountArray.add("" + loginLogService.countDay(currentDay));
loginCountArray[index] = loginLogService.countDay(currentDay);
} }
Map<String, Object> result = new HashMap<>(2); Map<String, Object> result = new HashMap<>(2);
result.put("dateArray", dateArray); result.put("dateArray", dateArray);