|
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
class AssetServiceTest extends ApplicationTests {
|
|
class AssetServiceTest extends ApplicationTests {
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -82,12 +83,14 @@ class AssetServiceTest extends ApplicationTests {
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
public void stat() {
|
|
public void stat() {
|
|
|
- List<User> match = assetService.holdQuery(Arrays.asList("国潮-兰陵武王-高长恭", "国潮-燕南三士-赵云", "国潮-武安君-李牧", "国潮-战神无双-吕布"),
|
|
|
|
|
|
|
+ Map<User, Integer> match = assetService.holdQuery(Arrays.asList("国潮-兰陵武王-高长恭", "国潮-燕南三士-赵云", "国潮-武安君-李牧", "国潮-战神无双-吕布"),
|
|
|
LocalDateTime.of(2021, 12, 23, 23, 0, 0),
|
|
LocalDateTime.of(2021, 12, 23, 23, 0, 0),
|
|
|
LocalDateTime.of(2021, 12, 23, 23, 59, 59));
|
|
LocalDateTime.of(2021, 12, 23, 23, 59, 59));
|
|
|
- for (User user : match) {
|
|
|
|
|
- System.out.printf("%d,%s,%s%n", user.getId(), user.getNickname(), user.getPhone());
|
|
|
|
|
|
|
+ System.out.println("用户ID,昵称,手机,持有套数");
|
|
|
|
|
+ for (Map.Entry<User, Integer> e : match.entrySet()) {
|
|
|
|
|
+ User user = e.getKey();
|
|
|
|
|
+ System.out.printf("%d,%s,%s,%d%n", user.getId(), user.getNickname(), user.getPhone(), e.getValue());
|
|
|
}
|
|
}
|
|
|
- System.out.println(match);
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|