mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
(improvement)(project) Remove additional logging dependencies and use logback as the primary logging framework. (#1235)
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package com.tencent.supersonic.headless.server.aspect;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.common.jsqlparser.FieldExpression;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlReplaceHelper;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlSelectHelper;
|
||||
import com.tencent.supersonic.common.pojo.Filter;
|
||||
import com.tencent.supersonic.common.pojo.QueryColumn;
|
||||
import com.tencent.supersonic.common.pojo.enums.FilterOperatorEnum;
|
||||
import com.tencent.supersonic.common.pojo.exception.InvalidArgumentException;
|
||||
import com.tencent.supersonic.common.util.JsonUtil;
|
||||
import com.tencent.supersonic.common.jsqlparser.FieldExpression;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlReplaceHelper;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlSelectHelper;
|
||||
import com.tencent.supersonic.headless.api.pojo.DimValueMap;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.request.QuerySqlReq;
|
||||
@@ -18,16 +18,8 @@ import com.tencent.supersonic.headless.api.pojo.response.DimensionResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.SemanticQueryResp;
|
||||
import com.tencent.supersonic.headless.server.pojo.MetaFilter;
|
||||
import com.tencent.supersonic.headless.server.web.service.DimensionService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
@@ -36,6 +28,14 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Aspect
|
||||
@Component
|
||||
@Slf4j
|
||||
@@ -176,7 +176,7 @@ public class DimValueAspect {
|
||||
Map<String, String> techAndBizPair = dimAndTechNameAndBizNamePair.get(bizName);
|
||||
if (!CollectionUtils.isEmpty(techAndBizPair) && techAndBizPair.containsKey(techName)) {
|
||||
String bizValueName = techAndBizPair.get(techName);
|
||||
if (Strings.isNotEmpty(bizValueName)) {
|
||||
if (StringUtils.isNotEmpty(bizValueName)) {
|
||||
line.put(bizName, bizValueName);
|
||||
}
|
||||
}
|
||||
@@ -255,12 +255,12 @@ public class DimValueAspect {
|
||||
if (needSkipDimValue(dimValueMap)) {
|
||||
continue;
|
||||
}
|
||||
if (Strings.isNotEmpty(dimValueMap.getBizName())) {
|
||||
if (StringUtils.isNotEmpty(dimValueMap.getBizName())) {
|
||||
aliasAndBizNameToTechName.put(dimValueMap.getBizName(), dimValueMap.getTechName());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(dimValueMap.getAlias())) {
|
||||
dimValueMap.getAlias().stream().forEach(alias -> {
|
||||
if (Strings.isNotEmpty(alias)) {
|
||||
if (StringUtils.isNotEmpty(alias)) {
|
||||
aliasAndBizNameToTechName.put(alias, dimValueMap.getTechName());
|
||||
}
|
||||
});
|
||||
@@ -275,7 +275,7 @@ public class DimValueAspect {
|
||||
}
|
||||
|
||||
private boolean needSkipDimValue(DimValueMap dimValueMap) {
|
||||
return Objects.isNull(dimValueMap) || Strings.isEmpty(dimValueMap.getTechName());
|
||||
return Objects.isNull(dimValueMap) || StringUtils.isEmpty(dimValueMap.getTechName());
|
||||
}
|
||||
|
||||
private Map<String, Map<String, String>> getTechNameToBizName(List<DimensionResp> dimensions) {
|
||||
@@ -308,7 +308,7 @@ public class DimValueAspect {
|
||||
}
|
||||
|
||||
private boolean needSkipDimension(DimensionResp dimension) {
|
||||
return Objects.isNull(dimension) || Strings.isEmpty(dimension.getBizName()) || CollectionUtils.isEmpty(
|
||||
return Objects.isNull(dimension) || StringUtils.isEmpty(dimension.getBizName()) || CollectionUtils.isEmpty(
|
||||
dimension.getDimValueMaps());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.tencent.supersonic.headless.server.aspect;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
@@ -101,7 +100,7 @@ public class S2DataPermissionAspect {
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
User user = (User) objects[1];
|
||||
if (Objects.isNull(user) || Strings.isNullOrEmpty(user.getName())) {
|
||||
if (Objects.isNull(user) || StringUtils.isEmpty(user.getName())) {
|
||||
throw new RuntimeException("please provide user information");
|
||||
}
|
||||
List<Long> modelIds = getModelsInDataSet(queryReq);
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.tencent.supersonic.headless.server.persistence.mapper.ClassMapper;
|
||||
import com.tencent.supersonic.headless.server.persistence.repository.ClassRepository;
|
||||
import com.tencent.supersonic.headless.server.pojo.ClassFilter;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
@@ -52,7 +52,7 @@ public class ClassRepositoryImpl implements ClassRepository {
|
||||
if (Objects.nonNull(filter.getDataSetId())) {
|
||||
wrapper.lambda().eq(ClassDO::getDataSetId, filter.getDataSetId());
|
||||
}
|
||||
if (Strings.isNotEmpty(filter.getType())) {
|
||||
if (StringUtils.isNotEmpty(filter.getType())) {
|
||||
wrapper.lambda().eq(ClassDO::getType, filter.getType());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(filter.getIds())) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.tencent.supersonic.headless.server.persistence.mapper.StatMapper;
|
||||
import com.tencent.supersonic.headless.server.persistence.repository.StatRepository;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -70,7 +70,7 @@ public class StatRepositoryImpl implements StatRepository {
|
||||
}
|
||||
|
||||
private void updateStatMapInfo(Map<String, Long> map, String dimensions, String type, Long dataSetId) {
|
||||
if (Strings.isNotEmpty(dimensions)) {
|
||||
if (StringUtils.isNotEmpty(dimensions)) {
|
||||
try {
|
||||
List<String> dimensionList = mapper.readValue(dimensions, new TypeReference<List<String>>() {
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.tencent.supersonic.headless.api.pojo.response.DataSetSchemaResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.DimSchemaResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.MetricSchemaResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.TermResp;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -180,7 +180,7 @@ public class DataSetSchemaBuilder {
|
||||
List<DimValueMap> dimValueMaps = dim.getDimValueMaps();
|
||||
if (!CollectionUtils.isEmpty(dimValueMaps)) {
|
||||
for (DimValueMap dimValueMap : dimValueMaps) {
|
||||
if (Strings.isNotEmpty(dimValueMap.getBizName())) {
|
||||
if (StringUtils.isNotEmpty(dimValueMap.getBizName())) {
|
||||
dimValueAlias.add(dimValueMap.getBizName());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(dimValueMap.getAlias())) {
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
package com.tencent.supersonic.headless.server.utils;
|
||||
|
||||
import static com.tencent.supersonic.common.pojo.Constants.AND_UPPER;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.APOSTROPHE;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.COMMA;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.POUND;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.SPACE;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.common.pojo.Aggregator;
|
||||
import com.tencent.supersonic.common.pojo.Constants;
|
||||
@@ -33,13 +26,21 @@ import com.tencent.supersonic.headless.api.pojo.response.MetricResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.ModelResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.SemanticQueryResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.TagResp;
|
||||
import com.tencent.supersonic.headless.server.facade.service.SemanticLayerService;
|
||||
import com.tencent.supersonic.headless.server.persistence.dataobject.DictConfDO;
|
||||
import com.tencent.supersonic.headless.server.persistence.dataobject.DictTaskDO;
|
||||
import com.tencent.supersonic.headless.server.web.service.DimensionService;
|
||||
import com.tencent.supersonic.headless.server.web.service.MetricService;
|
||||
import com.tencent.supersonic.headless.server.web.service.ModelService;
|
||||
import com.tencent.supersonic.headless.server.facade.service.SemanticLayerService;
|
||||
import com.tencent.supersonic.headless.server.web.service.TagMetaService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
@@ -52,12 +53,12 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.StringJoiner;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import static com.tencent.supersonic.common.pojo.Constants.AND_UPPER;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.APOSTROPHE;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.COMMA;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.POUND;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.SPACE;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@@ -112,7 +113,7 @@ public class DictUtils {
|
||||
taskDO.setConfig(JsonUtil.toString(dictItemResp.getConfig()));
|
||||
taskDO.setStatus(status.getStatus());
|
||||
taskDO.setCreatedAt(createAt);
|
||||
String creator = (Objects.isNull(user) || Strings.isNullOrEmpty(user.getName())) ? "" : user.getName();
|
||||
String creator = (Objects.isNull(user) || StringUtils.isEmpty(user.getName())) ? "" : user.getName();
|
||||
taskDO.setCreatedBy(creator);
|
||||
return taskDO;
|
||||
}
|
||||
@@ -124,7 +125,7 @@ public class DictUtils {
|
||||
confDO.setConfig(JsonUtil.toString(itemValueReq.getConfig()));
|
||||
Date createAt = new Date();
|
||||
confDO.setCreatedAt(createAt);
|
||||
String creator = Strings.isNullOrEmpty(user.getName()) ? "" : user.getName();
|
||||
String creator = StringUtils.isEmpty(user.getName()) ? "" : user.getName();
|
||||
confDO.setCreatedBy(creator);
|
||||
confDO.setStatus(itemValueReq.getStatus().name());
|
||||
return confDO;
|
||||
@@ -180,7 +181,7 @@ public class DictUtils {
|
||||
metricObject = line.get(key);
|
||||
}
|
||||
}
|
||||
if (!Strings.isNullOrEmpty(dimValue) && Objects.nonNull(metricObject)) {
|
||||
if (!StringUtils.isEmpty(dimValue) && Objects.nonNull(metricObject)) {
|
||||
Long metric = Math.round(Double.parseDouble(metricObject.toString()));
|
||||
mergeMultivaluedValue(valueAndFrequencyPair, dimValue, metric);
|
||||
}
|
||||
@@ -201,7 +202,7 @@ public class DictUtils {
|
||||
}
|
||||
List<String> whiteList = dictItemResp.getConfig().getWhiteList();
|
||||
whiteList.forEach(white -> {
|
||||
if (!Strings.isNullOrEmpty(white)) {
|
||||
if (!StringUtils.isEmpty(white)) {
|
||||
white = white.replace(SPACE, POUND);
|
||||
}
|
||||
lines.add(String.format("%s %s %s", white, nature, itemValueWhiteFrequency));
|
||||
@@ -214,7 +215,7 @@ public class DictUtils {
|
||||
}
|
||||
|
||||
valueAndFrequencyPair.forEach((value, frequency) -> {
|
||||
if (!Strings.isNullOrEmpty(value)) {
|
||||
if (!StringUtils.isEmpty(value)) {
|
||||
value = value.replace(SPACE, POUND);
|
||||
}
|
||||
lines.add(String.format("%s %s %s", value, nature, frequency));
|
||||
@@ -222,7 +223,7 @@ public class DictUtils {
|
||||
}
|
||||
|
||||
private void mergeMultivaluedValue(Map<String, Long> valueAndFrequencyPair, String dimValue, Long metric) {
|
||||
if (org.apache.logging.log4j.util.Strings.isEmpty(dimValue)) {
|
||||
if (StringUtils.isEmpty(dimValue)) {
|
||||
return;
|
||||
}
|
||||
Map<String, Long> tmp = new HashMap<>();
|
||||
@@ -252,7 +253,7 @@ public class DictUtils {
|
||||
String sqlPattern = "select %s, %s from tbl %s group by %s order by %s desc limit %d";
|
||||
String bizName = dictItemResp.getBizName();
|
||||
String whereStr = generateWhereStr(dictItemResp);
|
||||
String where = Strings.isNullOrEmpty(whereStr) ? "" : "WHERE" + whereStr;
|
||||
String where = StringUtils.isEmpty(whereStr) ? "" : "WHERE" + whereStr;
|
||||
ItemValueConfig config = dictItemResp.getConfig();
|
||||
Long limit = (Objects.isNull(config) || Objects.isNull(config.getLimit())) ? itemValueMaxCount :
|
||||
dictItemResp.getConfig().getLimit();
|
||||
@@ -293,7 +294,7 @@ public class DictUtils {
|
||||
String sqlPattern = "select %s,count(1) from tbl %s group by %s order by count(1) desc limit %d";
|
||||
String bizName = dictItemResp.getBizName();
|
||||
String whereStr = generateWhereStr(dictItemResp);
|
||||
String where = Strings.isNullOrEmpty(whereStr) ? "" : "WHERE" + whereStr;
|
||||
String where = StringUtils.isEmpty(whereStr) ? "" : "WHERE" + whereStr;
|
||||
ItemValueConfig config = dictItemResp.getConfig();
|
||||
Long limit = (Objects.isNull(config) || Objects.isNull(config.getLimit())) ? itemValueMaxCount :
|
||||
dictItemResp.getConfig().getLimit();
|
||||
@@ -365,7 +366,7 @@ public class DictUtils {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
String whereStr = generateWhereStr(dictItemResp);
|
||||
if (Strings.isNullOrEmpty(whereStr)) {
|
||||
if (StringUtils.isEmpty(whereStr)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Filter filter = new Filter("", FilterOperatorEnum.SQL_PART, whereStr);
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.tencent.supersonic.headless.api.pojo.response.DimensionResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.ModelResp;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.DataSetResp;
|
||||
import com.tencent.supersonic.headless.server.persistence.dataobject.DimensionDO;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -76,10 +76,10 @@ public class DimensionConverter {
|
||||
}
|
||||
dimensionResp.setModelFilterSql(
|
||||
modelRespMap.getOrDefault(dimensionResp.getModelId(), new ModelResp()).getFilterSql());
|
||||
if (Strings.isNotEmpty(dimensionDO.getDimValueMaps())) {
|
||||
if (StringUtils.isNotEmpty(dimensionDO.getDimValueMaps())) {
|
||||
dimensionResp.setDimValueMaps(JsonUtil.toList(dimensionDO.getDimValueMaps(), DimValueMap.class));
|
||||
}
|
||||
if (Strings.isNotEmpty(dimensionDO.getDataType())) {
|
||||
if (StringUtils.isNotEmpty(dimensionDO.getDataType())) {
|
||||
dimensionResp.setDataType(DataTypeEnums.of(dimensionDO.getDataType()));
|
||||
}
|
||||
if (dimensionDO.getExt() != null) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.tencent.supersonic.headless.server.utils;
|
||||
|
||||
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlReplaceHelper;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlSelectFunctionHelper;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlSelectHelper;
|
||||
import com.tencent.supersonic.common.pojo.Aggregator;
|
||||
import com.tencent.supersonic.common.pojo.Constants;
|
||||
import com.tencent.supersonic.common.pojo.enums.AggOperatorEnum;
|
||||
import com.tencent.supersonic.common.pojo.enums.QueryType;
|
||||
import com.tencent.supersonic.common.pojo.enums.TimeDimensionEnum;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlReplaceHelper;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlSelectFunctionHelper;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlSelectHelper;
|
||||
import com.tencent.supersonic.headless.api.pojo.Measure;
|
||||
import com.tencent.supersonic.headless.api.pojo.MetricTable;
|
||||
import com.tencent.supersonic.headless.api.pojo.QueryParam;
|
||||
@@ -31,7 +31,6 @@ import com.tencent.supersonic.headless.core.utils.SqlGenerateUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -160,7 +159,7 @@ public class QueryReqConverter {
|
||||
return AggOption.OUTER;
|
||||
}
|
||||
long defaultAggNullCnt = metricSchemas.stream()
|
||||
.filter(m -> Objects.isNull(m.getDefaultAgg()) || Strings.isBlank(m.getDefaultAgg())).count();
|
||||
.filter(m -> Objects.isNull(m.getDefaultAgg()) || StringUtils.isBlank(m.getDefaultAgg())).count();
|
||||
if (defaultAggNullCnt > 0) {
|
||||
log.info("getAggOption find null defaultAgg metric set to NATIVE");
|
||||
return AggOption.OUTER;
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.tencent.supersonic.headless.api.pojo.enums.QueryRuleType;
|
||||
import com.tencent.supersonic.headless.api.pojo.request.QueryRuleReq;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.QueryRuleResp;
|
||||
import com.tencent.supersonic.headless.server.persistence.dataobject.QueryRuleDO;
|
||||
import org.apache.directory.api.util.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -33,7 +33,7 @@ public class QueryRuleConverter {
|
||||
BeanUtils.copyProperties(queryRuleDO, queryRuleResp);
|
||||
queryRuleResp.setRuleType(QueryRuleType.valueOf(queryRuleDO.getRuleType()));
|
||||
queryRuleResp.setRule(JsonUtil.toObject(queryRuleDO.getRule(), RuleInfo.class));
|
||||
queryRuleResp.setAction(Strings.isEmpty(queryRuleDO.getAction()) ? new ActionInfo() :
|
||||
queryRuleResp.setAction(StringUtils.isEmpty(queryRuleDO.getAction()) ? new ActionInfo() :
|
||||
JsonUtil.toObject(queryRuleDO.getAction(), ActionInfo.class));
|
||||
queryRuleResp.setExt(JsonUtil.toMap(queryRuleDO.getExt(), String.class, String.class));
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlSelectHelper;
|
||||
import com.tencent.supersonic.common.pojo.enums.TaskStatusEnum;
|
||||
import com.tencent.supersonic.common.util.SqlFilterUtils;
|
||||
import com.tencent.supersonic.common.jsqlparser.SqlSelectHelper;
|
||||
import com.tencent.supersonic.headless.api.pojo.QueryStat;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.QueryOptMode;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.QueryMethod;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.QueryOptMode;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.QueryTypeBack;
|
||||
import com.tencent.supersonic.headless.api.pojo.request.ItemUseReq;
|
||||
import com.tencent.supersonic.headless.api.pojo.request.QueryMultiStructReq;
|
||||
@@ -22,7 +22,7 @@ import com.tencent.supersonic.headless.api.pojo.response.ItemUseResp;
|
||||
import com.tencent.supersonic.headless.server.persistence.repository.StatRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -33,6 +33,8 @@ import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
;
|
||||
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@@ -217,7 +219,7 @@ public class StatUtils {
|
||||
}
|
||||
|
||||
private String getUserName(User facadeUser) {
|
||||
return (Objects.nonNull(facadeUser) && Strings.isNotEmpty(facadeUser.getName())) ? facadeUser.getName()
|
||||
return (Objects.nonNull(facadeUser) && StringUtils.isNotEmpty(facadeUser.getName())) ? facadeUser.getName()
|
||||
: "Admin";
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.tencent.supersonic.common.util.JsonUtil;
|
||||
import com.tencent.supersonic.headless.api.pojo.request.TagObjectReq;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.TagObjectResp;
|
||||
import com.tencent.supersonic.headless.server.persistence.dataobject.TagObjectDO;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@@ -24,7 +24,7 @@ public class TagObjectConverter {
|
||||
public static TagObjectResp convert2Resp(TagObjectDO tagObjectDO) {
|
||||
TagObjectResp tagObjectResp = new TagObjectResp();
|
||||
BeanUtils.copyProperties(tagObjectDO, tagObjectResp);
|
||||
if (Strings.isNotEmpty(tagObjectDO.getExt())) {
|
||||
if (StringUtils.isNotEmpty(tagObjectDO.getExt())) {
|
||||
tagObjectResp.setExt(JsonUtil.objectToMapString(tagObjectDO.getExt()));
|
||||
}
|
||||
return tagObjectResp;
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.tencent.supersonic.headless.server.persistence.mapper.CollectMapper;
|
||||
import com.tencent.supersonic.headless.server.web.service.CollectService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -26,7 +25,7 @@ public class CollectServiceImpl implements CollectService {
|
||||
@Override
|
||||
public Boolean collect(User user, CollectDO collectReq) {
|
||||
CollectDO collect = new CollectDO();
|
||||
collect.setType(Strings.isEmpty(collectReq.getType()) ? type : collectReq.getType());
|
||||
collect.setType(StringUtils.isEmpty(collectReq.getType()) ? type : collectReq.getType());
|
||||
collect.setUsername(user.getName());
|
||||
collect.setCollectId(collectReq.getCollectId());
|
||||
collectMapper.insert(collect);
|
||||
|
||||
@@ -42,7 +42,6 @@ import com.tencent.supersonic.headless.server.utils.ModelConverter;
|
||||
import com.tencent.supersonic.headless.server.utils.NameCheckUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -264,10 +263,10 @@ public class ModelServiceImpl implements ModelService {
|
||||
String startDate1 = item.getStartDate();
|
||||
String endDate1 = item.getEndDate();
|
||||
List<String> unavailableDateList1 = item.getUnavailableDateList();
|
||||
if (Strings.isNotEmpty(startDate1) && startDate1.compareTo(startDate) > 0) {
|
||||
if (StringUtils.isNotEmpty(startDate1) && startDate1.compareTo(startDate) > 0) {
|
||||
startDate = startDate1;
|
||||
}
|
||||
if (Strings.isNotEmpty(endDate1) && endDate1.compareTo(endDate) < 0) {
|
||||
if (StringUtils.isNotEmpty(endDate1) && endDate1.compareTo(endDate) < 0) {
|
||||
endDate = endDate1;
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(unavailableDateList1)) {
|
||||
|
||||
Reference in New Issue
Block a user