|
@@ -6,6 +6,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.LocalTime;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@SpringBootTest
|
|
@SpringBootTest
|
|
|
@RunWith(SpringRunner.class)
|
|
@RunWith(SpringRunner.class)
|
|
@@ -13,6 +17,8 @@ public class StatisticServiceTest {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private StatisticService statisticService;
|
|
private StatisticService statisticService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CacheService cacheService;
|
|
|
|
|
|
|
|
@Test
|
|
@Test
|
|
|
public void total() {
|
|
public void total() {
|
|
@@ -33,4 +39,19 @@ public class StatisticServiceTest {
|
|
|
public void orderPriceTrend() {
|
|
public void orderPriceTrend() {
|
|
|
System.out.println(statisticService.orderPriceTrend(7));
|
|
System.out.println(statisticService.orderPriceTrend(7));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Test
|
|
|
|
|
+ public void top() {
|
|
|
|
|
+ LocalDate now = LocalDate.now();
|
|
|
|
|
+ LocalDate endDate = now.minusDays(now.getDayOfWeek().getValue());
|
|
|
|
|
+ LocalDateTime start = LocalDateTime.of(endDate.minusDays(6), LocalTime.MIN);
|
|
|
|
|
+ System.out.println(start);
|
|
|
|
|
+ String top = statisticService.top(start, LocalDateTime.of(endDate, LocalTime.MAX), 50);
|
|
|
|
|
+ System.out.println(top);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Test
|
|
|
|
|
+ public void test() {
|
|
|
|
|
+ cacheService.clearWeekTop();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|