mongodb currency 관련 작업
currency 작업 스케줄 추가
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.caliverse.admin.Indicators.Indicatorsservice.aggregationservice;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@@ -25,7 +26,8 @@ public class IndicatorsAuLoadService extends IndicatorsLogLoadServiceBase {
|
||||
public <T extends IndicatorsLog> List<T> getIndicatorsLogData(String startTime, String endTime, Class<T> clazz) {
|
||||
|
||||
Criteria criteria = makeCriteria(startTime, endTime);
|
||||
List<AggregationOperation> operations = setDefaultOperation(criteria);
|
||||
// List<AggregationOperation> operations = setDefaultOperation(criteria);
|
||||
List<AggregationOperation> operations = new ArrayList<>();
|
||||
|
||||
|
||||
Aggregation aggregation = Aggregation.newAggregation(operations);
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package com.caliverse.admin.Indicators.Indicatorsservice.base;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
import org.springframework.data.mongodb.core.aggregation.Aggregation;
|
||||
import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
|
||||
import org.springframework.data.mongodb.core.aggregation.ProjectionOperation;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.caliverse.admin.global.common.constants.AdminConstants;
|
||||
|
||||
|
||||
@Service
|
||||
public abstract class IndicatorsLogLoadServiceBase implements IndicatorsLogLoadService {
|
||||
|
||||
@@ -37,31 +30,6 @@ public abstract class IndicatorsLogLoadServiceBase implements IndicatorsLogLoadS
|
||||
{
|
||||
return makeCriteria(startDate, endDate, AdminConstants.MONGO_DB_KEY_LOGTIME);
|
||||
}
|
||||
|
||||
// 24.12.13 현재 사용안함
|
||||
private AggregationOperation getDefaultProjectOperationName(){
|
||||
ProjectionOperation projectOperation = Aggregation.project()
|
||||
.and(AdminConstants.MONGO_DB_KEY_LOGDAY).as(AdminConstants.MONGO_DB_KEY_LOGDAY)
|
||||
.and(AdminConstants.INDICATORS_KEY_DAU_BY_LANG).as(AdminConstants.INDICATORS_KEY_DAU_BY_LANG)
|
||||
;
|
||||
return projectOperation;
|
||||
}
|
||||
|
||||
// 24.12.13 현재 사용안함
|
||||
protected List<AggregationOperation> setDefaultOperation(Criteria criteria){
|
||||
|
||||
List<AggregationOperation> operations = new ArrayList<>();
|
||||
|
||||
operations.add(Aggregation.match(criteria));
|
||||
operations.add(getDefaultProjectOperationName());
|
||||
|
||||
return operations;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.caliverse.admin.Indicators.entity;
|
||||
|
||||
import com.caliverse.admin.logs.Indicatordomain.CurrencyMongoLog;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Document(collection = "currency")
|
||||
public class CurrencyDetailLogInfo extends LogInfoBase{
|
||||
private String id;
|
||||
private String logDay;
|
||||
private String accountId;
|
||||
private String userGuid;
|
||||
private String userNickname;
|
||||
private String tranId;
|
||||
private String action;
|
||||
private String logTime;
|
||||
private String currencyType;
|
||||
private String amountDeltaType;
|
||||
private Double deltaAmount;
|
||||
|
||||
public CurrencyDetailLogInfo(String id,
|
||||
String logDay,
|
||||
String accountId,
|
||||
String userGuid,
|
||||
String userNickname,
|
||||
String tranId,
|
||||
String action,
|
||||
String logTime,
|
||||
String currencyType,
|
||||
String amountDeltaType,
|
||||
Double deltaAmount
|
||||
) {
|
||||
super(StatisticsType.CURRENCY);
|
||||
|
||||
this.id = id;
|
||||
this.logDay = logDay;
|
||||
this.accountId = accountId;
|
||||
this.userGuid = userGuid;
|
||||
this.userNickname = userNickname;
|
||||
this.tranId = tranId;
|
||||
this.action = action;
|
||||
this.logTime = logTime;
|
||||
this.currencyType = currencyType;
|
||||
this.amountDeltaType = amountDeltaType;
|
||||
this.deltaAmount = deltaAmount;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.caliverse.admin.Indicators.entity;
|
||||
|
||||
import com.caliverse.admin.logs.Indicatordomain.CurrencyMongoLog;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Document(collection = "currency")
|
||||
public class CurrencyLogInfo extends LogInfoBase{
|
||||
private String logDay;
|
||||
private String accountId;
|
||||
private String userGuid;
|
||||
private String userNickname;
|
||||
private Double sapphireAcquired;
|
||||
private Double sapphireConsumed;
|
||||
private Double sapphireNet;
|
||||
private Double goldAcquired;
|
||||
private Double goldConsumed;
|
||||
private Double goldNet;
|
||||
private Double caliumAcquired;
|
||||
private Double caliumConsumed;
|
||||
private Double caliumNet;
|
||||
private Double beamAcquired;
|
||||
private Double beamConsumed;
|
||||
private Double beamNet;
|
||||
private Double rubyAcquired;
|
||||
private Double rubyConsumed;
|
||||
private Double rubyNet;
|
||||
private Integer totalCurrencies;
|
||||
private List<CurrencyMongoLog.currency> currencies;
|
||||
|
||||
public CurrencyLogInfo(String logDay,
|
||||
String accountId,
|
||||
String userGuid,
|
||||
String userNickname,
|
||||
Double sapphireAcquired,
|
||||
Double sapphireConsumed,
|
||||
Double sapphireNet,
|
||||
Double goldAcquired,
|
||||
Double goldConsumed,
|
||||
Double goldNet,
|
||||
Double caliumAcquired,
|
||||
Double caliumConsumed,
|
||||
Double caliumNet,
|
||||
Double beamAcquired,
|
||||
Double beamConsumed,
|
||||
Double beamNet,
|
||||
Double rubyAcquired,
|
||||
Double rubyConsumed,
|
||||
Double rubyNet,
|
||||
Integer totalCurrencies,
|
||||
List<CurrencyMongoLog.currency> currencies
|
||||
) {
|
||||
super(StatisticsType.CURRENCY);
|
||||
|
||||
this.logDay = logDay;
|
||||
this.accountId = accountId;
|
||||
this.userGuid = userGuid;
|
||||
this.userNickname = userNickname;
|
||||
this.sapphireAcquired = sapphireAcquired;
|
||||
this.sapphireConsumed = sapphireConsumed;
|
||||
this.sapphireNet = sapphireNet;
|
||||
this.goldAcquired = goldAcquired;
|
||||
this.goldConsumed = goldConsumed;
|
||||
this.goldNet = goldNet;
|
||||
this.caliumAcquired = caliumAcquired;
|
||||
this.caliumConsumed = caliumConsumed;
|
||||
this.caliumNet = caliumNet;
|
||||
this.beamAcquired = beamAcquired;
|
||||
this.beamConsumed = beamConsumed;
|
||||
this.beamNet = beamNet;
|
||||
this.rubyAcquired = rubyAcquired;
|
||||
this.rubyConsumed = rubyConsumed;
|
||||
this.rubyNet = rubyNet;
|
||||
this.totalCurrencies = totalCurrencies;
|
||||
this.currencies = currencies;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,7 +16,8 @@ public enum StatisticsType {
|
||||
SERVER_INFO,
|
||||
MONEY,
|
||||
USER_CREATE,
|
||||
USER_LOGIN
|
||||
USER_LOGIN,
|
||||
CURRENCY
|
||||
;
|
||||
|
||||
public static StatisticsType getStatisticsType(String type) {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.caliverse.admin.Indicators.indicatorrepository;
|
||||
|
||||
import com.caliverse.admin.Indicators.entity.CurrencyLogInfo;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
|
||||
public interface IndicatorCurrencyRepository extends MongoRepository<CurrencyLogInfo, String> {
|
||||
}
|
||||
Reference in New Issue
Block a user