비즈니스로그 멀티필터
This commit is contained in:
@@ -45,11 +45,10 @@ public class LogService {
|
||||
int page = logGenericRequest.getPageNo();
|
||||
int size = logGenericRequest.getPageSize();
|
||||
|
||||
LocalDateTime startDt = logGenericRequest.getStartDt().plusHours(9);
|
||||
LocalDateTime endDt = logGenericRequest.getEndDt().plusHours(9).plusDays(1);
|
||||
|
||||
logGenericRequest.setStartDt(startDt);
|
||||
logGenericRequest.setEndDt(endDt);
|
||||
// LocalDateTime startDt = logGenericRequest.getStartDt().plusHours(9);
|
||||
// LocalDateTime endDt = logGenericRequest.getEndDt().plusHours(9).plusDays(1);
|
||||
// logGenericRequest.setStartDt(startDt);
|
||||
// logGenericRequest.setEndDt(endDt);
|
||||
|
||||
// List<Map<String, Object>> logList = businessLogGenericService.loadBusinessLogData(logGenericRequest);
|
||||
List<GenericMongoLog> logList = new ArrayList<>();
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -36,11 +37,17 @@ public class BusinessLogGenericService extends BusinessLogServiceBase {
|
||||
super(mongoTemplate);
|
||||
}
|
||||
|
||||
public <T> List<T> loadBusinessLogData(LogGenericRequest logGenericRequest, Class<T> class1){
|
||||
return loadBusinessLogData(logGenericRequest, class1, false);
|
||||
}
|
||||
|
||||
// public List<Map<String, Object>> loadBusinessLogData(LogGenericRequest logGenericRequest) {
|
||||
public <T> List<T> loadBusinessLogData(LogGenericRequest logGenericRequest, Class<T> class1) {
|
||||
String startTime = logGenericRequest.getStartDt().toString().substring(0, 10);
|
||||
String endTime = logGenericRequest.getEndDt().toString().substring(0, 10);
|
||||
public <T> List<T> loadBusinessLogData(LogGenericRequest logGenericRequest, Class<T> class1, boolean isSimple) {
|
||||
LocalDateTime startDt = logGenericRequest.getStartDt().plusHours(9);
|
||||
LocalDateTime endDt = logGenericRequest.getEndDt().plusHours(9).plusDays(1);
|
||||
|
||||
String startTime = startDt.toString().substring(0, 10);
|
||||
String endTime = endDt.toString().substring(0, 10);
|
||||
LogAction logAction = logGenericRequest.getLogAction();
|
||||
LogDomain logDomain = logGenericRequest.getLogDomain();
|
||||
SearchUserType searchUserType = logGenericRequest.getSearchType();
|
||||
@@ -223,25 +230,17 @@ public class BusinessLogGenericService extends BusinessLogServiceBase {
|
||||
}
|
||||
}
|
||||
|
||||
// if(filters != null && !filters.isEmpty()) {
|
||||
// List<Document> filterDocuments = new ArrayList<>();
|
||||
//
|
||||
// for (LogGenericRequest.LogFilter filter : filters) {
|
||||
// if (filter.getFieldName() != null && !filter.getFieldName().isEmpty() &&
|
||||
// filter.getValue() != null) {
|
||||
// Document filterDoc = new Document(filter.getFieldName(), filter.getValue());
|
||||
// filterDocuments.add(filterDoc);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (!filterDocuments.isEmpty()) {
|
||||
// operations.add(context ->
|
||||
// new Document("$match",
|
||||
// new Document("$and", filterDocuments)
|
||||
// )
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
if(isSimple){
|
||||
operations.add(context ->
|
||||
new Document("$project",
|
||||
new Document(AdminConstants.MONGO_DB_KEY_ACCOUNT_ID, 1)
|
||||
.append(AdminConstants.MONGO_DB_KEY_USER_GUID, 1)
|
||||
.append(AdminConstants.MONGO_DB_KEY_USER_NICKNAME, 1)
|
||||
.append(AdminConstants.MONGO_DB_KEY_LOGTIME, 1)
|
||||
.append("body", 1)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// 최종 출력 형식
|
||||
operations.add(context ->
|
||||
|
||||
Reference in New Issue
Block a user