|
|
|
@ -3,7 +3,7 @@ package com.dashboard.aws.lambda.handler; |
|
|
|
import com.amazonaws.services.lambda.runtime.Context; |
|
|
|
import com.amazonaws.services.lambda.runtime.RequestHandler; |
|
|
|
import com.dashboard.aws.lambda.entity.AggregationLevel; |
|
|
|
import com.dashboard.aws.lambda.service.AggregationService; |
|
|
|
import com.dashboard.aws.lambda.service.AccumulateIncrementService; |
|
|
|
import com.dashboard.aws.lambda.service.MySQLService; |
|
|
|
import com.dashboard.aws.lambda.util.DateUtil; |
|
|
|
import org.slf4j.Logger; |
|
|
|
@ -14,10 +14,10 @@ import java.time.ZoneId; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
public class AggregationHandler implements RequestHandler<Map<String, Object>, String> { |
|
|
|
public class AccumulateIncrementHandler implements RequestHandler<Map<String, Object>, String> { |
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(AggregationHandler.class); |
|
|
|
private final AggregationService aggregationService = new AggregationService(); |
|
|
|
private static final Logger logger = LoggerFactory.getLogger(AccumulateIncrementHandler.class); |
|
|
|
private final AccumulateIncrementService accumulateIncrementService = new AccumulateIncrementService(); |
|
|
|
private final MySQLService mysqlService = new MySQLService(); |
|
|
|
|
|
|
|
@Override |
|
|
|
@ -36,7 +36,7 @@ public class AggregationHandler implements RequestHandler<Map<String, Object>, S |
|
|
|
for (Long companyId : companyIds) { |
|
|
|
for (AggregationLevel level : levels) { |
|
|
|
logger.info("Start aggregation [company:{}, level:{}]", companyId, level); |
|
|
|
aggregationService.aggregate(companyId, level, now); |
|
|
|
accumulateIncrementService.aggregate(companyId, level, now); |
|
|
|
} |
|
|
|
} |
|
|
|
|