mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
[improvement] supersonic adapt checkstyle (#451)
This commit is contained in:
@@ -29,7 +29,6 @@ public abstract class AuthenticationInterceptor implements HandlerInterceptor {
|
|||||||
|
|
||||||
protected S2ThreadContext s2ThreadContext;
|
protected S2ThreadContext s2ThreadContext;
|
||||||
|
|
||||||
|
|
||||||
protected boolean isExcludedUri(String uri) {
|
protected boolean isExcludedUri(String uri) {
|
||||||
String excludePathStr = authenticationConfig.getExcludePath();
|
String excludePathStr = authenticationConfig.getExcludePath();
|
||||||
if (Strings.isEmpty(excludePathStr)) {
|
if (Strings.isEmpty(excludePathStr)) {
|
||||||
@@ -59,7 +58,6 @@ public abstract class AuthenticationInterceptor implements HandlerInterceptor {
|
|||||||
return "true".equalsIgnoreCase(internal);
|
return "true".equalsIgnoreCase(internal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void reflectSetparam(HttpServletRequest request, String key, String value) {
|
protected void reflectSetparam(HttpServletRequest request, String key, String value) {
|
||||||
try {
|
try {
|
||||||
if (request instanceof StandardMultipartHttpServletRequest) {
|
if (request instanceof StandardMultipartHttpServletRequest) {
|
||||||
|
|||||||
@@ -76,5 +76,4 @@ public class DefaultAuthenticationInterceptor extends AuthenticationInterceptor
|
|||||||
s2ThreadContext.set(threadContext);
|
s2ThreadContext.set(threadContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ public class UserRepositoryImpl implements UserRepository {
|
|||||||
this.userDOMapper = userDOMapper;
|
this.userDOMapper = userDOMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserDO> getUserList() {
|
public List<UserDO> getUserList() {
|
||||||
return userDOMapper.selectByExample(new UserDOExample());
|
return userDOMapper.selectByExample(new UserDOExample());
|
||||||
@@ -40,5 +39,4 @@ public class UserRepositoryImpl implements UserRepository {
|
|||||||
return userDOOptional.orElse(null);
|
return userDOOptional.orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ public class UserController {
|
|||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/getCurrentUser")
|
@GetMapping("/getCurrentUser")
|
||||||
public User getCurrentUser(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
public User getCurrentUser(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
|
||||||
return UserHolder.findUser(httpServletRequest, httpServletResponse);
|
return UserHolder.findUser(httpServletRequest, httpServletResponse);
|
||||||
@@ -70,5 +69,4 @@ public class UserController {
|
|||||||
return userService.login(userCmd);
|
return userService.login(userCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class UserServiceImpl implements UserService {
|
public class UserServiceImpl implements UserService {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getUserNames() {
|
public List<String> getUserNames() {
|
||||||
return ComponentFactory.getUserAdaptor().getUserNames();
|
return ComponentFactory.getUserAdaptor().getUserNames();
|
||||||
|
|||||||
@@ -20,5 +20,4 @@ public class FakeUserStrategy implements UserStrategy {
|
|||||||
return User.getFakeUser();
|
return User.getFakeUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ public class UserTokenUtils {
|
|||||||
return generate(claims);
|
return generate(claims);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public User getUser(HttpServletRequest request) {
|
public User getUser(HttpServletRequest request) {
|
||||||
String token = request.getHeader(authenticationConfig.getTokenHttpHeaderKey());
|
String token = request.getHeader(authenticationConfig.getTokenHttpHeaderKey());
|
||||||
final Claims claims = getClaims(token);
|
final Claims claims = getClaims(token);
|
||||||
@@ -120,5 +119,4 @@ public class UserTokenUtils {
|
|||||||
.compact();
|
.compact();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ public class AuthServiceImpl implements AuthService {
|
|||||||
jdbcTemplate.update("delete from s2_auth_groups where group_id = ?", group.getGroupId());
|
jdbcTemplate.update("delete from s2_auth_groups where group_id = ?", group.getGroupId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AuthorizedResourceResp queryAuthorizedResources(QueryAuthResReq req, User user) {
|
public AuthorizedResourceResp queryAuthorizedResources(QueryAuthResReq req, User user) {
|
||||||
Set<String> userOrgIds = userService.getUserAllOrgId(user.getName());
|
Set<String> userOrgIds = userService.getUserAllOrgId(user.getName());
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ public abstract class BaseSemanticCorrector implements SemanticCorrector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public abstract void doCorrect(QueryReq queryReq, SemanticParseInfo semanticParseInfo);
|
public abstract void doCorrect(QueryReq queryReq, SemanticParseInfo semanticParseInfo);
|
||||||
|
|
||||||
protected Map<String, String> getFieldNameMap(Set<Long> modelIds) {
|
protected Map<String, String> getFieldNameMap(Set<Long> modelIds) {
|
||||||
|
|||||||
@@ -62,5 +62,4 @@ public class HavingCorrector extends BaseSemanticCorrector {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ public class SchemaCorrector extends BaseSemanticCorrector {
|
|||||||
return parseResult.getLinkingValues();
|
return parseResult.getLinkingValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void updateFieldValueByLinkingValue(SemanticParseInfo semanticParseInfo) {
|
private void updateFieldValueByLinkingValue(SemanticParseInfo semanticParseInfo) {
|
||||||
List<ElementValue> linking = getLinkingValues(semanticParseInfo);
|
List<ElementValue> linking = getLinkingValues(semanticParseInfo);
|
||||||
if (CollectionUtils.isEmpty(linking)) {
|
if (CollectionUtils.isEmpty(linking)) {
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ public abstract class BaseMapper implements SchemaMapper {
|
|||||||
|
|
||||||
public abstract void doMap(QueryContext queryContext);
|
public abstract void doMap(QueryContext queryContext);
|
||||||
|
|
||||||
|
|
||||||
public void addToSchemaMap(SchemaMapInfo schemaMap, Long modelId, SchemaElementMatch newElementMatch) {
|
public void addToSchemaMap(SchemaMapInfo schemaMap, Long modelId, SchemaElementMatch newElementMatch) {
|
||||||
Map<Long, List<SchemaElementMatch>> modelElementMatches = schemaMap.getModelElementMatches();
|
Map<Long, List<SchemaElementMatch>> modelElementMatches = schemaMap.getModelElementMatches();
|
||||||
List<SchemaElementMatch> schemaElementMatches = modelElementMatches.putIfAbsent(modelId, new ArrayList<>());
|
List<SchemaElementMatch> schemaElementMatches = modelElementMatches.putIfAbsent(modelId, new ArrayList<>());
|
||||||
|
|||||||
@@ -154,5 +154,4 @@ public abstract class BaseMatchStrategy<T> implements MatchStrategy<T> {
|
|||||||
public abstract void detectByStep(QueryContext queryContext, Set<T> results,
|
public abstract void detectByStep(QueryContext queryContext, Set<T> results,
|
||||||
Set<Long> detectModelIds, Integer startIndex, Integer index, int offset);
|
Set<Long> detectModelIds, Integer startIndex, Integer index, int offset);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ public class EmbeddingMatchStrategy extends BaseMatchStrategy<EmbeddingResult> {
|
|||||||
return a.getName() + Constants.UNDERLINE + a.getId();
|
return a.getName() + Constants.UNDERLINE + a.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void detectByBatch(QueryContext queryContext, Set<EmbeddingResult> results, Set<Long> detectModelIds,
|
protected void detectByBatch(QueryContext queryContext, Set<EmbeddingResult> results, Set<Long> detectModelIds,
|
||||||
Set<String> detectSegments) {
|
Set<String> detectSegments) {
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public class FuzzyNameMatchStrategy extends BaseMatchStrategy<FuzzyResult> {
|
|||||||
private SchemaService schemaService;
|
private SchemaService schemaService;
|
||||||
private List<SchemaElement> allElements;
|
private List<SchemaElement> allElements;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<MatchText, List<FuzzyResult>> match(QueryContext queryContext, List<Term> terms,
|
public Map<MatchText, List<FuzzyResult>> match(QueryContext queryContext, List<Term> terms,
|
||||||
Set<Long> detectModelIds) {
|
Set<Long> detectModelIds) {
|
||||||
@@ -97,7 +96,6 @@ public class FuzzyNameMatchStrategy extends BaseMatchStrategy<FuzzyResult> {
|
|||||||
return allElements;
|
return allElements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Double getThreshold(QueryContext queryContext) {
|
private Double getThreshold(QueryContext queryContext) {
|
||||||
Double metricDimensionThresholdConfig = optimizationConfig.getMetricDimensionThresholdConfig();
|
Double metricDimensionThresholdConfig = optimizationConfig.getMetricDimensionThresholdConfig();
|
||||||
Double metricDimensionMinThresholdConfig = optimizationConfig.getMetricDimensionMinThresholdConfig();
|
Double metricDimensionMinThresholdConfig = optimizationConfig.getMetricDimensionMinThresholdConfig();
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ public class HanlpDictMapper extends BaseMapper {
|
|||||||
convertTermsToSchemaMapInfo(matches, queryContext.getMapInfo(), terms);
|
convertTermsToSchemaMapInfo(matches, queryContext.getMapInfo(), terms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void convertTermsToSchemaMapInfo(List<HanlpMapResult> hanlpMapResults, SchemaMapInfo schemaMap,
|
private void convertTermsToSchemaMapInfo(List<HanlpMapResult> hanlpMapResults, SchemaMapInfo schemaMap,
|
||||||
List<Term> terms) {
|
List<Term> terms) {
|
||||||
if (CollectionUtils.isEmpty(hanlpMapResults)) {
|
if (CollectionUtils.isEmpty(hanlpMapResults)) {
|
||||||
@@ -82,5 +81,4 @@ public class HanlpDictMapper extends BaseMapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ public class MapperHelper {
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Integer getStepOffset(List<Term> termList, Integer index) {
|
public Integer getStepOffset(List<Term> termList, Integer index) {
|
||||||
List<Integer> offsetList = termList.stream().sorted(Comparator.comparing(Term::getOffset))
|
List<Integer> offsetList = termList.stream().sorted(Comparator.comparing(Term::getOffset))
|
||||||
.map(term -> term.getOffset()).collect(Collectors.toList());
|
.map(term -> term.getOffset()).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ public abstract class PluginParser implements SemanticParser {
|
|||||||
return semanticParseInfo;
|
return semanticParseInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void fillSemanticParseInfo(SemanticParseInfo semanticParseInfo) {
|
private void fillSemanticParseInfo(SemanticParseInfo semanticParseInfo) {
|
||||||
List<SchemaElementMatch> schemaElementMatches = semanticParseInfo.getElementMatches();
|
List<SchemaElementMatch> schemaElementMatches = semanticParseInfo.getElementMatches();
|
||||||
if (CollectionUtils.isEmpty(schemaElementMatches)) {
|
if (CollectionUtils.isEmpty(schemaElementMatches)) {
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ public class HeuristicModelResolver implements ModelResolver {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Map<String, ModelMatchResult> getModelTypeMap(SchemaModelClusterMapInfo schemaMap) {
|
public static Map<String, ModelMatchResult> getModelTypeMap(SchemaModelClusterMapInfo schemaMap) {
|
||||||
Map<String, ModelMatchResult> modelCount = new HashMap<>();
|
Map<String, ModelMatchResult> modelCount = new HashMap<>();
|
||||||
for (Map.Entry<String, List<SchemaElementMatch>> entry : schemaMap.getModelElementMatches().entrySet()) {
|
for (Map.Entry<String, List<SchemaElementMatch>> entry : schemaMap.getModelElementMatches().entrySet()) {
|
||||||
@@ -114,7 +113,6 @@ public class HeuristicModelResolver implements ModelResolver {
|
|||||||
return modelCount;
|
return modelCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String resolve(QueryContext queryContext, ChatContext chatCtx, Set<Long> restrictiveModels) {
|
public String resolve(QueryContext queryContext, ChatContext chatCtx, Set<Long> restrictiveModels) {
|
||||||
SchemaModelClusterMapInfo mapInfo = queryContext.getModelClusterMapInfo();
|
SchemaModelClusterMapInfo mapInfo = queryContext.getModelClusterMapInfo();
|
||||||
Set<String> matchedModelClusters = mapInfo.getElementMatchesByModelIds(restrictiveModels).keySet();
|
Set<String> matchedModelClusters = mapInfo.getElementMatchesByModelIds(restrictiveModels).keySet();
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ public class LLMRequestService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OptimizationConfig optimizationConfig;
|
private OptimizationConfig optimizationConfig;
|
||||||
|
|
||||||
|
|
||||||
public boolean check(QueryContext queryCtx) {
|
public boolean check(QueryContext queryCtx) {
|
||||||
QueryReq request = queryCtx.getRequest();
|
QueryReq request = queryCtx.getRequest();
|
||||||
if (StringUtils.isEmpty(llmParserConfig.getUrl())) {
|
if (StringUtils.isEmpty(llmParserConfig.getUrl())) {
|
||||||
@@ -192,7 +191,6 @@ public class LLMRequestService {
|
|||||||
return extraInfoSb.toString();
|
return extraInfoSb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected List<ElementValue> getValueList(QueryContext queryCtx, ModelCluster modelCluster) {
|
protected List<ElementValue> getValueList(QueryContext queryCtx, ModelCluster modelCluster) {
|
||||||
Map<Long, String> itemIdToName = getItemIdToName(modelCluster);
|
Map<Long, String> itemIdToName = getItemIdToName(modelCluster);
|
||||||
|
|
||||||
@@ -223,7 +221,6 @@ public class LLMRequestService {
|
|||||||
.collect(Collectors.toMap(SchemaElement::getId, SchemaElement::getName, (value1, value2) -> value2));
|
.collect(Collectors.toMap(SchemaElement::getId, SchemaElement::getName, (value1, value2) -> value2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Set<String> getTopNFieldNames(ModelCluster modelCluster, LLMParserConfig llmParserConfig) {
|
private Set<String> getTopNFieldNames(ModelCluster modelCluster, LLMParserConfig llmParserConfig) {
|
||||||
SemanticSchema semanticSchema = schemaService.getSemanticSchema();
|
SemanticSchema semanticSchema = schemaService.getSemanticSchema();
|
||||||
Set<String> results = semanticSchema.getDimensions(modelCluster.getModelIds()).stream()
|
Set<String> results = semanticSchema.getDimensions(modelCluster.getModelIds()).stream()
|
||||||
@@ -242,7 +239,6 @@ public class LLMRequestService {
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected Set<String> getMatchedFieldNames(QueryContext queryCtx, ModelCluster modelCluster) {
|
protected Set<String> getMatchedFieldNames(QueryContext queryCtx, ModelCluster modelCluster) {
|
||||||
Map<Long, String> itemIdToName = getItemIdToName(modelCluster);
|
Map<Long, String> itemIdToName = getItemIdToName(modelCluster);
|
||||||
List<SchemaElementMatch> matchedElements = queryCtx.getModelClusterMapInfo()
|
List<SchemaElementMatch> matchedElements = queryCtx.getModelClusterMapInfo()
|
||||||
|
|||||||
@@ -79,5 +79,4 @@ public class LLMSqlParser implements SemanticParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public class ChatContextRepositoryImpl implements ChatContextRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private ChatContext cast(ChatContextDO contextDO) {
|
private ChatContext cast(ChatContextDO contextDO) {
|
||||||
ChatContext chatContext = new ChatContext();
|
ChatContext chatContext = new ChatContext();
|
||||||
chatContext.setChatId(contextDO.getChatId());
|
chatContext.setChatId(contextDO.getChatId());
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ public class ChatQueryRepositoryImpl implements ChatQueryRepository {
|
|||||||
return chatQueryDOMapper.updateByPrimaryKeyWithBLOBs(chatQueryDO);
|
return chatQueryDOMapper.updateByPrimaryKeyWithBLOBs(chatQueryDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ChatParseDO getParseInfo(Long questionId, int parseId) {
|
public ChatParseDO getParseInfo(Long questionId, int parseId) {
|
||||||
return chatParseMapper.getParseInfo(questionId, parseId);
|
return chatParseMapper.getParseInfo(questionId, parseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public class ChatRepositoryImpl implements ChatRepository {
|
|||||||
return chatMapper.getAll(creator, agentId);
|
return chatMapper.getAll(creator, agentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateChatName(Long chatId, String chatName, String lastTime, String creator) {
|
public Boolean updateChatName(Long chatId, String chatName, String lastTime, String creator) {
|
||||||
return chatMapper.updateChatName(chatId, chatName, lastTime, creator);
|
return chatMapper.updateChatName(chatId, chatName, lastTime, creator);
|
||||||
|
|||||||
@@ -24,5 +24,4 @@ public class StatisticsRepositoryImpl implements StatisticsRepository {
|
|||||||
statisticsMapper.batchSaveStatistics(list);
|
statisticsMapper.batchSaveStatistics(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -285,7 +285,6 @@ public class PluginManager {
|
|||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static List<ParamOption> getSemanticOption(Plugin plugin) {
|
private static List<ParamOption> getSemanticOption(Plugin plugin) {
|
||||||
WebBase webBase = JSONObject.parseObject(plugin.getConfig(), WebBase.class);
|
WebBase webBase = JSONObject.parseObject(plugin.getConfig(), WebBase.class);
|
||||||
if (Objects.isNull(webBase)) {
|
if (Objects.isNull(webBase)) {
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ public class MetricCheckProcessor implements ParseResultProcessor {
|
|||||||
return removeFieldInSql(correctSql, metricToRemove, groupByToRemove, whereFieldsToRemove);
|
return removeFieldInSql(correctSql, metricToRemove, groupByToRemove, whereFieldsToRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To check whether the dimension bound to the metric exists,
|
* To check whether the dimension bound to the metric exists,
|
||||||
* eg: metric like UV is calculated in a certain dimension, it cannot be used on other dimensions.
|
* eg: metric like UV is calculated in a certain dimension, it cannot be used on other dimensions.
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class TimeCostProcessor implements ParseResultProcessor {
|
public class TimeCostProcessor implements ParseResultProcessor {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(ParseResp parseResp, QueryContext queryContext, ChatContext chatContext) {
|
public void process(ParseResp parseResp, QueryContext queryContext, ChatContext chatContext) {
|
||||||
long parseStartTime = parseResp.getParseTimeCost().getParseStartTime();
|
long parseStartTime = parseResp.getParseTimeCost().getParseStartTime();
|
||||||
@@ -19,5 +18,4 @@ public class TimeCostProcessor implements ParseResultProcessor {
|
|||||||
System.currentTimeMillis() - parseStartTime - parseResp.getParseTimeCost().getSqlTime());
|
System.currentTimeMillis() - parseStartTime - parseResp.getParseTimeCost().getSqlTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ public class MetricAnalyzeQuery extends LLMSemanticQuery {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String replaceAnswer(String text, Map<String, String> replacedMap) {
|
private String replaceAnswer(String text, Map<String, String> replacedMap) {
|
||||||
for (String key : replacedMap.keySet()) {
|
for (String key : replacedMap.keySet()) {
|
||||||
text = text.replaceAll(key, replacedMap.get(key));
|
text = text.replaceAll(key, replacedMap.get(key));
|
||||||
@@ -149,7 +148,6 @@ public class MetricAnalyzeQuery extends LLMSemanticQuery {
|
|||||||
return tableBuilder.toString();
|
return tableBuilder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String fetchInterpret(String queryText, String dataText) {
|
public String fetchInterpret(String queryText, String dataText) {
|
||||||
PluginManager pluginManager = ContextUtils.getBean(PluginManager.class);
|
PluginManager pluginManager = ContextUtils.getBean(PluginManager.class);
|
||||||
LLMAnswerReq lLmAnswerReq = new LLMAnswerReq();
|
LLMAnswerReq lLmAnswerReq = new LLMAnswerReq();
|
||||||
@@ -164,5 +162,4 @@ public class MetricAnalyzeQuery extends LLMSemanticQuery {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,7 +191,6 @@ public abstract class RuleSemanticQuery extends BaseSemanticQuery {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public QueryResult execute(User user) {
|
public QueryResult execute(User user) {
|
||||||
String queryMode = parseInfo.getQueryMode();
|
String queryMode = parseInfo.getQueryMode();
|
||||||
@@ -285,7 +284,6 @@ public abstract class RuleSemanticQuery extends BaseSemanticQuery {
|
|||||||
return matchedQueries;
|
return matchedQueries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected QueryStructReq convertQueryStruct() {
|
protected QueryStructReq convertQueryStruct() {
|
||||||
return QueryReqBuilder.buildStructReq(parseInfo);
|
return QueryReqBuilder.buildStructReq(parseInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ public class ChatConfigController {
|
|||||||
|
|
||||||
private SemanticInterpreter semanticInterpreter = ComponentFactory.getSemanticLayer();
|
private SemanticInterpreter semanticInterpreter = ComponentFactory.getSemanticLayer();
|
||||||
|
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Long addChatConfig(@RequestBody ChatConfigBaseReq extendBaseCmd,
|
public Long addChatConfig(@RequestBody ChatConfigBaseReq extendBaseCmd,
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
@@ -59,7 +58,6 @@ public class ChatConfigController {
|
|||||||
return configService.editConfig(extendEditCmd, user);
|
return configService.editConfig(extendEditCmd, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/search")
|
@PostMapping("/search")
|
||||||
public List<ChatConfigResp> search(@RequestBody ChatConfigFilter filter,
|
public List<ChatConfigResp> search(@RequestBody ChatConfigFilter filter,
|
||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
@@ -68,7 +66,6 @@ public class ChatConfigController {
|
|||||||
return configService.search(filter, user);
|
return configService.search(filter, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/richDesc/{modelId}")
|
@GetMapping("/richDesc/{modelId}")
|
||||||
public ChatConfigRichResp getModelExtendRichInfo(@PathVariable("modelId") Long modelId) {
|
public ChatConfigRichResp getModelExtendRichInfo(@PathVariable("modelId") Long modelId) {
|
||||||
return configService.getConfigRichInfo(modelId);
|
return configService.getConfigRichInfo(modelId);
|
||||||
@@ -123,5 +120,4 @@ public class ChatConfigController {
|
|||||||
return semanticInterpreter.getMetricPage(pageMetricReq, user);
|
return semanticInterpreter.getMetricPage(pageMetricReq, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public class ChatQueryController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SearchService searchService;
|
private SearchService searchService;
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("search")
|
@PostMapping("search")
|
||||||
public Object search(@RequestBody QueryReq queryCtx, HttpServletRequest request,
|
public Object search(@RequestBody QueryReq queryCtx, HttpServletRequest request,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ public class ChatServiceImpl implements ChatService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChatContext getOrCreateContext(int chatId) {
|
public ChatContext getOrCreateContext(int chatId) {
|
||||||
return chatContextRepository.getOrCreateContext(chatId);
|
return chatContextRepository.getOrCreateContext(chatId);
|
||||||
@@ -90,7 +89,6 @@ public class ChatServiceImpl implements ChatService {
|
|||||||
chatCtx.setParseInfo(new SemanticParseInfo());
|
chatCtx.setParseInfo(new SemanticParseInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean addChat(User user, String chatName, Integer agentId) {
|
public Boolean addChat(User user, String chatName, Integer agentId) {
|
||||||
ChatDO chatDO = new ChatDO();
|
ChatDO chatDO = new ChatDO();
|
||||||
@@ -176,7 +174,6 @@ public class ChatServiceImpl implements ChatService {
|
|||||||
return showCaseResp;
|
return showCaseResp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void fillParseInfo(List<QueryResp> queryResps) {
|
private void fillParseInfo(List<QueryResp> queryResps) {
|
||||||
List<Long> queryIds = queryResps.stream()
|
List<Long> queryIds = queryResps.stream()
|
||||||
.map(QueryResp::getQuestionId).collect(Collectors.toList());
|
.map(QueryResp::getQuestionId).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ public class ConfigServiceImpl implements ConfigService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long editConfig(ChatConfigEditReqReq configEditCmd, User user) {
|
public Long editConfig(ChatConfigEditReqReq configEditCmd, User user) {
|
||||||
log.info("[edit model extend] object:{}", JsonUtil.toString(configEditCmd, true));
|
log.info("[edit model extend] object:{}", JsonUtil.toString(configEditCmd, true));
|
||||||
@@ -168,13 +167,11 @@ public class ConfigServiceImpl implements ConfigService {
|
|||||||
return chaConfigDescList;
|
return chaConfigDescList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChatConfigResp fetchConfigByModelId(Long modelId) {
|
public ChatConfigResp fetchConfigByModelId(Long modelId) {
|
||||||
return chatConfigRepository.getConfigByModelId(modelId);
|
return chatConfigRepository.getConfigByModelId(modelId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private ItemVisibilityInfo fetchVisibilityDescByConfig(ItemVisibility visibility,
|
private ItemVisibilityInfo fetchVisibilityDescByConfig(ItemVisibility visibility,
|
||||||
ModelSchema modelSchema) {
|
ModelSchema modelSchema) {
|
||||||
ItemVisibilityInfo itemVisibilityDesc = new ItemVisibilityInfo();
|
ItemVisibilityInfo itemVisibilityDesc = new ItemVisibilityInfo();
|
||||||
@@ -329,7 +326,6 @@ public class ConfigServiceImpl implements ConfigService {
|
|||||||
return defaultRichConfig;
|
return defaultRichConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<KnowledgeInfoReq> fillKnowledgeBizName(List<KnowledgeInfoReq> knowledgeInfos,
|
private List<KnowledgeInfoReq> fillKnowledgeBizName(List<KnowledgeInfoReq> knowledgeInfos,
|
||||||
ModelSchema modelSchema) {
|
ModelSchema modelSchema) {
|
||||||
if (CollectionUtils.isEmpty(knowledgeInfos)) {
|
if (CollectionUtils.isEmpty(knowledgeInfos)) {
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ public class PluginServiceImpl implements PluginService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Plugin> getPluginList() {
|
public List<Plugin> getPluginList() {
|
||||||
List<Plugin> plugins = Lists.newArrayList();
|
List<Plugin> plugins = Lists.newArrayList();
|
||||||
@@ -90,7 +89,6 @@ public class PluginServiceImpl implements PluginService {
|
|||||||
return convertList(pluginDOS);
|
return convertList(pluginDOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Plugin> query(PluginQueryReq pluginQueryReq) {
|
public List<Plugin> query(PluginQueryReq pluginQueryReq) {
|
||||||
PluginDOExample pluginDOExample = new PluginDOExample();
|
PluginDOExample pluginDOExample = new PluginDOExample();
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ public class QueryServiceImpl implements QueryService {
|
|||||||
return parseResult;
|
return parseResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@TimeCost
|
@TimeCost
|
||||||
public QueryResult performExecution(ExecuteQueryReq queryReq) throws Exception {
|
public QueryResult performExecution(ExecuteQueryReq queryReq) throws Exception {
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ public class ChatConfigHelper {
|
|||||||
return chatConfig;
|
return chatConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ChatConfig editChatConfig(ChatConfigEditReqReq extendEditCmd, User facadeUser) {
|
public ChatConfig editChatConfig(ChatConfigEditReqReq extendEditCmd, User facadeUser) {
|
||||||
ChatConfig chatConfig = new ChatConfig();
|
ChatConfig chatConfig = new ChatConfig();
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ public class DictQueryHelper {
|
|||||||
@Value("${dimension.white.weight:60000000}")
|
@Value("${dimension.white.weight:60000000}")
|
||||||
private Long dimensionWhiteWeight;
|
private Long dimensionWhiteWeight;
|
||||||
|
|
||||||
|
|
||||||
public List<String> fetchDimValueSingle(Long modelId, DefaultMetric defaultMetricDesc, Dim4Dict dim4Dict,
|
public List<String> fetchDimValueSingle(Long modelId, DefaultMetric defaultMetricDesc, Dim4Dict dim4Dict,
|
||||||
User user) {
|
User user) {
|
||||||
List<String> data = new ArrayList<>();
|
List<String> data = new ArrayList<>();
|
||||||
|
|||||||
@@ -242,5 +242,4 @@ public class QueryReqBuilder {
|
|||||||
return queryStructCmd;
|
return queryStructCmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import org.junit.jupiter.api.Test;
|
|||||||
|
|
||||||
class LoadRemoveServiceTest {
|
class LoadRemoveServiceTest {
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void edit() {
|
void edit() {
|
||||||
int compute = EditDistance.compute("在", "在你的身边");
|
int compute = EditDistance.compute("在", "在你的身边");
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ public interface FileHandler {
|
|||||||
*/
|
*/
|
||||||
void createDir(String path);
|
void createDir(String path);
|
||||||
|
|
||||||
|
|
||||||
Boolean existPath(String path);
|
Boolean existPath(String path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ public class LocalFileHandler implements FileHandler {
|
|||||||
return Paths.get(path).toAbsolutePath().toString();
|
return Paths.get(path).toAbsolutePath().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDictRootPath() {
|
public String getDictRootPath() {
|
||||||
return Paths.get(localFileConfig.getDictDirectoryLatest()).toAbsolutePath().toString();
|
return Paths.get(localFileConfig.getDictDirectoryLatest()).toAbsolutePath().toString();
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ public class DimensionWordBuilder extends BaseWordBuilder {
|
|||||||
@Value("${nlp.dimension.use.suffix:true}")
|
@Value("${nlp.dimension.use.suffix:true}")
|
||||||
private boolean nlpDimensionUseSuffix = true;
|
private boolean nlpDimensionUseSuffix = true;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DictWord> doGet(String word, SchemaElement schemaElement) {
|
public List<DictWord> doGet(String word, SchemaElement schemaElement) {
|
||||||
List<DictWord> result = Lists.newArrayList();
|
List<DictWord> result = Lists.newArrayList();
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ public class DictRepositoryImpl implements DictRepository {
|
|||||||
return dictTaskDO.getId();
|
return dictTaskDO.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateDictTaskStatus(Integer status, DictTaskDO dictTaskDO) {
|
public Boolean updateDictTaskStatus(Integer status, DictTaskDO dictTaskDO) {
|
||||||
dictTaskDO.setStatus(status);
|
dictTaskDO.setStatus(status);
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public class KnowledgeServiceImpl implements KnowledgeService {
|
|||||||
SearchService.loadSuffix(suffixes);
|
SearchService.loadSuffix(suffixes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void reloadAllData(List<DictWord> natures) {
|
public void reloadAllData(List<DictWord> natures) {
|
||||||
// 1. reload custom knowledge
|
// 1. reload custom knowledge
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ public class LoadRemoveService {
|
|||||||
@Value("${mapper.remove.nature.prefix:}")
|
@Value("${mapper.remove.nature.prefix:}")
|
||||||
private String mapperRemoveNaturePrefix;
|
private String mapperRemoveNaturePrefix;
|
||||||
|
|
||||||
|
|
||||||
public List removeNatures(List value, Integer agentId, Set<Long> detectModelIds) {
|
public List removeNatures(List value, Integer agentId, Set<Long> detectModelIds) {
|
||||||
if (CollectionUtils.isEmpty(value)) {
|
if (CollectionUtils.isEmpty(value)) {
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -118,7 +118,6 @@ public class SearchService {
|
|||||||
trie.put(key, getValue(attribute.nature));
|
trie.put(key, getValue(attribute.nature));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void loadSuffix(List<DictWord> suffixes) {
|
public static void loadSuffix(List<DictWord> suffixes) {
|
||||||
if (CollectionUtils.isEmpty(suffixes)) {
|
if (CollectionUtils.isEmpty(suffixes)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ public class NatureHelper {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static long getModelCount(List<Term> terms) {
|
private static long getModelCount(List<Term> terms) {
|
||||||
return terms.stream().filter(term -> isModelOrEntity(term, getModelByNature(term.nature))).count();
|
return terms.stream().filter(term -> isModelOrEntity(term, getModelByNature(term.nature))).count();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,5 @@ public class DataBaseConfig {
|
|||||||
public DataSource dataSource() {
|
public DataSource dataSource() {
|
||||||
return new DruidDataSource();
|
return new DruidDataSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,5 +19,4 @@ public class PageBaseReq {
|
|||||||
return this.pageSize;
|
return this.pageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ public class RecordInfo {
|
|||||||
|
|
||||||
private Date updatedAt;
|
private Date updatedAt;
|
||||||
|
|
||||||
|
|
||||||
public RecordInfo createdBy(String userName) {
|
public RecordInfo createdBy(String userName) {
|
||||||
this.createdBy = userName;
|
this.createdBy = userName;
|
||||||
this.createdAt = new Date();
|
this.createdAt = new Date();
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ public enum ReturnCode {
|
|||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getCode() {
|
public int getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,5 +52,4 @@ public enum AggOperatorEnum {
|
|||||||
return null != aggType && aggType.toUpperCase().equals(COUNT_DISTINCT.getOperator());
|
return null != aggType && aggType.toUpperCase().equals(COUNT_DISTINCT.getOperator());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,6 @@ public enum AggregateTypeEnum {
|
|||||||
COUNT,
|
COUNT,
|
||||||
NONE;
|
NONE;
|
||||||
|
|
||||||
|
|
||||||
public static AggregateTypeEnum of(String agg) {
|
public static AggregateTypeEnum of(String agg) {
|
||||||
for (AggregateTypeEnum aggEnum : AggregateTypeEnum.values()) {
|
for (AggregateTypeEnum aggEnum : AggregateTypeEnum.values()) {
|
||||||
if (aggEnum.name().equalsIgnoreCase(agg)) {
|
if (aggEnum.name().equalsIgnoreCase(agg)) {
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public enum DictWordType {
|
|||||||
return NATURE_SPILT + type;
|
return NATURE_SPILT + type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static DictWordType getNatureType(String nature) {
|
public static DictWordType getNatureType(String nature) {
|
||||||
if (StringUtils.isEmpty(nature) || !nature.startsWith(NATURE_SPILT)) {
|
if (StringUtils.isEmpty(nature) || !nature.startsWith(NATURE_SPILT)) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -41,12 +41,10 @@ public enum FilterOperatorEnum {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean isValueCompare(FilterOperatorEnum filterOperatorEnum) {
|
public static boolean isValueCompare(FilterOperatorEnum filterOperatorEnum) {
|
||||||
return EQUALS.equals(filterOperatorEnum) || GREATER_THAN.equals(filterOperatorEnum)
|
return EQUALS.equals(filterOperatorEnum) || GREATER_THAN.equals(filterOperatorEnum)
|
||||||
|| GREATER_THAN_EQUALS.equals(filterOperatorEnum) || MINOR_THAN.equals(filterOperatorEnum)
|
|| GREATER_THAN_EQUALS.equals(filterOperatorEnum) || MINOR_THAN.equals(filterOperatorEnum)
|
||||||
|| MINOR_THAN_EQUALS.equals(filterOperatorEnum) || NOT_EQUALS.equals(filterOperatorEnum);
|
|| MINOR_THAN_EQUALS.equals(filterOperatorEnum) || NOT_EQUALS.equals(filterOperatorEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,4 @@ public enum SensitiveLevelEnum {
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,5 +27,4 @@ public class SysParameterController {
|
|||||||
return sysParameterService.getSysParameter();
|
return sysParameterService.getSysParameter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,5 +29,4 @@ public class BeanMapper<T> {
|
|||||||
return (String[]) emptyNames.toArray(result);
|
return (String[]) emptyNames.toArray(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ public class ChatGptHelper {
|
|||||||
@Value("${llm.chatgpt.proxyPort:}")
|
@Value("${llm.chatgpt.proxyPort:}")
|
||||||
private Integer proxyPort;
|
private Integer proxyPort;
|
||||||
|
|
||||||
|
|
||||||
public ChatGPT getChatGPT() {
|
public ChatGPT getChatGPT() {
|
||||||
Proxy proxy = null;
|
Proxy proxy = null;
|
||||||
if (!"default".equals(proxyIp)) {
|
if (!"default".equals(proxyIp)) {
|
||||||
@@ -76,7 +75,6 @@ public class ChatGptHelper {
|
|||||||
return res.getContent();
|
return res.getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String mockAlias(String mockType,
|
public String mockAlias(String mockType,
|
||||||
String name,
|
String name,
|
||||||
String bizName,
|
String bizName,
|
||||||
@@ -124,7 +122,6 @@ public class ChatGptHelper {
|
|||||||
return res.getContent();
|
return res.getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String mockDimensionValueAlias(String json) {
|
public String mockDimensionValueAlias(String json) {
|
||||||
String msg = "Assuming you are a professional data analyst specializing in indicators,for you a json list,"
|
String msg = "Assuming you are a professional data analyst specializing in indicators,for you a json list,"
|
||||||
+ "the required content to follow is as follows: "
|
+ "the required content to follow is as follows: "
|
||||||
@@ -144,11 +141,9 @@ public class ChatGptHelper {
|
|||||||
return res.getContent();
|
return res.getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
ChatGptHelper chatGptHelper = new ChatGptHelper();
|
ChatGptHelper chatGptHelper = new ChatGptHelper();
|
||||||
System.out.println(chatGptHelper.mockAlias("", "", "", "", "", false));
|
System.out.println(chatGptHelper.mockAlias("", "", "", "", "", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ public class ContextUtils implements ApplicationContextAware {
|
|||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getActiveProfile() {
|
public static String getActiveProfile() {
|
||||||
String activeProfile = context.getEnvironment().getActiveProfiles()[0];
|
String activeProfile = context.getEnvironment().getActiveProfiles()[0];
|
||||||
if (StringUtils.isEmpty(activeProfile)) {
|
if (StringUtils.isEmpty(activeProfile)) {
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ public class DateModeUtils {
|
|||||||
dateInfo.getEndDate());
|
dateInfo.getEndDate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String generateMonthSql(LocalDate endData, Long unit, String dateFormatStr) {
|
public String generateMonthSql(LocalDate endData, Long unit, String dateFormatStr) {
|
||||||
LocalDate dateMax = endData;
|
LocalDate dateMax = endData;
|
||||||
List<String> months = generateMonthStr(dateMax, unit, dateFormatStr);
|
List<String> months = generateMonthStr(dateMax, unit, dateFormatStr);
|
||||||
@@ -227,7 +226,6 @@ public class DateModeUtils {
|
|||||||
return -1L;
|
return -1L;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String recentDateStr(ItemDateResp dateDate, DateConf dateInfo) {
|
public String recentDateStr(ItemDateResp dateDate, DateConf dateInfo) {
|
||||||
if (Objects.isNull(dateDate)) {
|
if (Objects.isNull(dateDate)) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -24,5 +24,4 @@ public enum DatePeriodEnum {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ public class DateUtils {
|
|||||||
return DateTimeFormatter.ofPattern(formats[0]);
|
return DateTimeFormatter.ofPattern(formats[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getBeforeDate(int intervalDay) {
|
public static String getBeforeDate(int intervalDay) {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTime(new Date());
|
calendar.setTime(new Date());
|
||||||
@@ -66,7 +65,6 @@ public class DateUtils {
|
|||||||
return dateFormat.format(calendar.getTime());
|
return dateFormat.format(calendar.getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String getBeforeDate(int intervalDay, DatePeriodEnum datePeriodEnum) {
|
public static String getBeforeDate(int intervalDay, DatePeriodEnum datePeriodEnum) {
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
|
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
|
||||||
String currentDate = dateFormat.format(new Date());
|
String currentDate = dateFormat.format(new Date());
|
||||||
@@ -107,7 +105,6 @@ public class DateUtils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String format(Date date) {
|
public static String format(Date date) {
|
||||||
DateFormat dateFormat;
|
DateFormat dateFormat;
|
||||||
if (containsTime(date)) {
|
if (containsTime(date)) {
|
||||||
|
|||||||
@@ -338,7 +338,6 @@ public class HttpClientUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param headers
|
* @param headers
|
||||||
* @param httpMethod
|
* @param httpMethod
|
||||||
@@ -507,7 +506,6 @@ public class HttpClientUtils {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* for us scheduling
|
* for us scheduling
|
||||||
*
|
*
|
||||||
@@ -595,7 +593,6 @@ public class HttpClientUtils {
|
|||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* for us scheduling, send delete
|
* for us scheduling, send delete
|
||||||
*
|
*
|
||||||
@@ -659,7 +656,6 @@ public class HttpClientUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static HttpClientResult doPutJson(String url, Map<String, String> headers, String req) {
|
public static HttpClientResult doPutJson(String url, Map<String, String> headers, String req) {
|
||||||
return RetryUtils.exec(() -> {
|
return RetryUtils.exec(() -> {
|
||||||
HttpPut httpPut = null;
|
HttpPut httpPut = null;
|
||||||
|
|||||||
@@ -171,7 +171,6 @@ public class JsonUtil {
|
|||||||
return INSTANCE.asmapToObject(map, clazz);
|
return INSTANCE.asmapToObject(map, clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对象转json
|
* 对象转json
|
||||||
*
|
*
|
||||||
@@ -418,7 +417,6 @@ public class JsonUtil {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对象转换成Map
|
* 对象转换成Map
|
||||||
*/
|
*/
|
||||||
@@ -445,7 +443,6 @@ public class JsonUtil {
|
|||||||
return objectMapper.convertValue(map, clazz);
|
return objectMapper.convertValue(map, clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Json转换成ListMap
|
* Json转换成ListMap
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ public class SqlFilterUtils {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getWhereClause(List<Filter> filters) {
|
public String getWhereClause(List<Filter> filters) {
|
||||||
return getWhereClause(filters, true);
|
return getWhereClause(filters, true);
|
||||||
}
|
}
|
||||||
@@ -248,5 +247,4 @@ public class SqlFilterUtils {
|
|||||||
return PARENTHESES_START + SPACE + criterion.getValue().toString() + SPACE + PARENTHESES_END;
|
return PARENTHESES_START + SPACE + criterion.getValue().toString() + SPACE + PARENTHESES_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,6 @@ public class YamlUtils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String toYamlWithoutNull(Object object) {
|
public static String toYamlWithoutNull(Object object) {
|
||||||
String jsonStr = JSONObject.toJSONString(object);
|
String jsonStr = JSONObject.toJSONString(object);
|
||||||
if (object instanceof List) {
|
if (object instanceof List) {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ public class Retrieval {
|
|||||||
|
|
||||||
protected Map<String, String> metadata;
|
protected Map<String, String> metadata;
|
||||||
|
|
||||||
|
|
||||||
public static Long getLongId(String id) {
|
public static Long getLongId(String id) {
|
||||||
if (StringUtils.isBlank(id)) {
|
if (StringUtils.isBlank(id)) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -48,5 +48,4 @@ public class DateFunctionHelper {
|
|||||||
return unit.getValue();
|
return unit.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,14 +86,12 @@ public class FieldAndValueAcquireVisitor extends ExpressionVisitorAdapter {
|
|||||||
fieldExpressions.add(fieldExpression);
|
fieldExpressions.add(fieldExpression);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(MinorThanEquals expr) {
|
public void visit(MinorThanEquals expr) {
|
||||||
FieldExpression fieldExpression = getFilterExpression(expr);
|
FieldExpression fieldExpression = getFilterExpression(expr);
|
||||||
fieldExpressions.add(fieldExpression);
|
fieldExpressions.add(fieldExpression);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(GreaterThan expr) {
|
public void visit(GreaterThan expr) {
|
||||||
FieldExpression fieldExpression = getFilterExpression(expr);
|
FieldExpression fieldExpression = getFilterExpression(expr);
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ public class FiledFilterReplaceVisitor extends ExpressionVisitorAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(GreaterThan expr) {
|
public void visit(GreaterThan expr) {
|
||||||
List<Expression> expressions = parserFilter(expr, JsqlConstants.GREATER_THAN_CONSTANT);
|
List<Expression> expressions = parserFilter(expr, JsqlConstants.GREATER_THAN_CONSTANT);
|
||||||
@@ -74,7 +73,6 @@ public class FiledFilterReplaceVisitor extends ExpressionVisitorAdapter {
|
|||||||
return waitingForAdds;
|
return waitingForAdds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<Expression> parserFilter(ComparisonOperator comparisonOperator, String condExpr) {
|
public List<Expression> parserFilter(ComparisonOperator comparisonOperator, String condExpr) {
|
||||||
List<Expression> result = new ArrayList<>();
|
List<Expression> result = new ArrayList<>();
|
||||||
String toString = comparisonOperator.toString();
|
String toString = comparisonOperator.toString();
|
||||||
|
|||||||
@@ -70,5 +70,4 @@ public class FiledNameReplaceVisitor extends ExpressionVisitorAdapter {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,6 @@ public class FilterRemoveVisitor extends ExpressionVisitorAdapter {
|
|||||||
expr.setLeftExpression(new LongValue(0L));
|
expr.setLeftExpression(new LongValue(0L));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(MinorThanEquals expr) {
|
public void visit(MinorThanEquals expr) {
|
||||||
if (!isRemove(expr.getLeftExpression())) {
|
if (!isRemove(expr.getLeftExpression())) {
|
||||||
@@ -64,7 +63,6 @@ public class FilterRemoveVisitor extends ExpressionVisitorAdapter {
|
|||||||
expr.setLeftExpression(new LongValue(1L));
|
expr.setLeftExpression(new LongValue(1L));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(GreaterThan expr) {
|
public void visit(GreaterThan expr) {
|
||||||
if (!isRemove(expr.getLeftExpression())) {
|
if (!isRemove(expr.getLeftExpression())) {
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ public class FunctionReplaceVisitor extends ExpressionVisitorAdapter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(GreaterThan expr) {
|
public void visit(GreaterThan expr) {
|
||||||
List<Expression> expressions = reparseDate(expr, "<");
|
List<Expression> expressions = reparseDate(expr, "<");
|
||||||
@@ -70,7 +69,6 @@ public class FunctionReplaceVisitor extends ExpressionVisitorAdapter {
|
|||||||
return waitingForAdds;
|
return waitingForAdds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<Expression> reparseDate(ComparisonOperator comparisonOperator, String startDateOperator) {
|
public List<Expression> reparseDate(ComparisonOperator comparisonOperator, String startDateOperator) {
|
||||||
List<Expression> result = new ArrayList<>();
|
List<Expression> result = new ArrayList<>();
|
||||||
Expression leftExpression = comparisonOperator.getLeftExpression();
|
Expression leftExpression = comparisonOperator.getLeftExpression();
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ public class SqlParserAddHelper {
|
|||||||
return selectStatement.toString();
|
return selectStatement.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String addWhere(String sql, Expression expression) {
|
public static String addWhere(String sql, Expression expression) {
|
||||||
Select selectStatement = SqlParserSelectHelper.getSelect(sql);
|
Select selectStatement = SqlParserSelectHelper.getSelect(sql);
|
||||||
SelectBody selectBody = selectStatement.getSelectBody();
|
SelectBody selectBody = selectStatement.getSelectBody();
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class SqlParserRemoveHelper {
|
|||||||
}
|
}
|
||||||
removeWhereExpression(whereExpression, removeFieldNames);
|
removeWhereExpression(whereExpression, removeFieldNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String removeNumberCondition(String sql) {
|
public static String removeNumberCondition(String sql) {
|
||||||
Select selectStatement = SqlParserSelectHelper.getSelect(sql);
|
Select selectStatement = SqlParserSelectHelper.getSelect(sql);
|
||||||
if (selectStatement == null) {
|
if (selectStatement == null) {
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ public class SqlParserSelectHelper {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<String> getSelectFields(String sql) {
|
public static List<String> getSelectFields(String sql) {
|
||||||
List<PlainSelect> plainSelectList = getPlainSelect(sql);
|
List<PlainSelect> plainSelectList = getPlainSelect(sql);
|
||||||
if (CollectionUtils.isEmpty(plainSelectList)) {
|
if (CollectionUtils.isEmpty(plainSelectList)) {
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ class SqlParseUtilsTest {
|
|||||||
Assert.assertTrue(addFieldToSql.toLowerCase().contains("pv"));
|
Assert.assertTrue(addFieldToSql.toLowerCase().contains("pv"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getSqlParseInfo() {
|
void getSqlParseInfo() {
|
||||||
|
|
||||||
@@ -115,7 +114,6 @@ class SqlParseUtilsTest {
|
|||||||
Assert.assertTrue(!selectFields.contains("play_count"));
|
Assert.assertTrue(!selectFields.contains("play_count"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getWhereFieldTest() {
|
void getWhereFieldTest() {
|
||||||
SqlParserInfo sqlParserInfo = SqlParseUtils.getSqlParseInfo(
|
SqlParserInfo sqlParserInfo = SqlParseUtils.getSqlParseInfo(
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ class SqlParserAddHelperTest {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addFunctionToSelect() {
|
void addFunctionToSelect() {
|
||||||
String sql = "SELECT user_name FROM 超音数 WHERE sys_imp_date <= '2023-09-03' AND "
|
String sql = "SELECT user_name FROM 超音数 WHERE sys_imp_date <= '2023-09-03' AND "
|
||||||
@@ -117,7 +116,6 @@ class SqlParserAddHelperTest {
|
|||||||
replaceSql);
|
replaceSql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addAggregateToMetricField() {
|
void addAggregateToMetricField() {
|
||||||
String sql = "select department, pv from t_1 where sys_imp_date = '2023-09-11' order by pv desc limit 10";
|
String sql = "select department, pv from t_1 where sys_imp_date = '2023-09-11' order by pv desc limit 10";
|
||||||
@@ -217,7 +215,6 @@ class SqlParserAddHelperTest {
|
|||||||
replaceSql);
|
replaceSql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addAggregateToCountDiscountMetricField() {
|
void addAggregateToCountDiscountMetricField() {
|
||||||
String sql = "select department, uv from t_1 where sys_imp_date = '2023-09-11' order by uv desc limit 10";
|
String sql = "select department, uv from t_1 where sys_imp_date = '2023-09-11' order by uv desc limit 10";
|
||||||
@@ -375,7 +372,6 @@ class SqlParserAddHelperTest {
|
|||||||
replaceSql);
|
replaceSql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addParenthesisToWhere() {
|
void addParenthesisToWhere() {
|
||||||
String sql = "select 歌曲名 from 歌曲库 where datediff('day', 发布日期, '2023-08-09') <= 1 "
|
String sql = "select 歌曲名 from 歌曲库 where datediff('day', 发布日期, '2023-08-09') <= 1 "
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ class SqlParserReplaceHelperTest {
|
|||||||
+ "ORDER BY 播放量 DESC LIMIT 11", replaceSql);
|
+ "ORDER BY 播放量 DESC LIMIT 11", replaceSql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void replaceFieldNameByValue() {
|
void replaceFieldNameByValue() {
|
||||||
|
|
||||||
@@ -350,7 +349,6 @@ class SqlParserReplaceHelperTest {
|
|||||||
+ "sum(user_id) < (SELECT min(user_id) FROM CSpider WHERE user_id = '英文')", replaceSql);
|
+ "sum(user_id) < (SELECT min(user_id) FROM CSpider WHERE user_id = '英文')", replaceSql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void replaceTable() {
|
void replaceTable() {
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ class SqlParserSelectFunctionHelperTest {
|
|||||||
Assert.assertEquals(hasAggregateFunction, true);
|
Assert.assertEquals(hasAggregateFunction, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void hasFunction() throws JSQLParserException {
|
void hasFunction() throws JSQLParserException {
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ class SqlParserSelectHelperTest {
|
|||||||
System.out.println(fieldExpression);
|
System.out.println(fieldExpression);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getAllFields() {
|
void getAllFields() {
|
||||||
|
|
||||||
@@ -173,7 +172,6 @@ class SqlParserSelectHelperTest {
|
|||||||
Assert.assertEquals(allFields.size(), 3);
|
Assert.assertEquals(allFields.size(), 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void getSelectFields() {
|
void getSelectFields() {
|
||||||
|
|
||||||
|
|||||||
@@ -299,7 +299,6 @@ public class ConfigureDemo implements ApplicationListener<ApplicationReadyEvent>
|
|||||||
return chatDetailConfig;
|
return chatDetailConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addDemoChatConfig_6() {
|
public void addDemoChatConfig_6() {
|
||||||
ChatConfigBaseReq chatConfigBaseReq = new ChatConfigBaseReq();
|
ChatConfigBaseReq chatConfigBaseReq = new ChatConfigBaseReq();
|
||||||
chatConfigBaseReq.setModelId(6L);
|
chatConfigBaseReq.setModelId(6L);
|
||||||
@@ -375,7 +374,6 @@ public class ConfigureDemo implements ApplicationListener<ApplicationReadyEvent>
|
|||||||
configService.addConfig(chatConfigBaseReq, user);
|
configService.addConfig(chatConfigBaseReq, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void addPlugin_1() {
|
private void addPlugin_1() {
|
||||||
Plugin plugin1 = new Plugin();
|
Plugin plugin1 = new Plugin();
|
||||||
plugin1.setType("WEB_PAGE");
|
plugin1.setType("WEB_PAGE");
|
||||||
@@ -502,5 +500,4 @@ public class ConfigureDemo implements ApplicationListener<ApplicationReadyEvent>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ public class DataUtils {
|
|||||||
return dimensionFilterExist;
|
return dimensionFilterExist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Agent getAgent() {
|
public static Agent getAgent() {
|
||||||
Agent agent = new Agent();
|
Agent agent = new Agent();
|
||||||
agent.setId(1);
|
agent.setId(1);
|
||||||
|
|||||||
@@ -29,5 +29,4 @@ public enum OperatorEnum {
|
|||||||
return operator;
|
return operator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,5 +31,4 @@ public enum QueryTypeBackEnum {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,5 +25,4 @@ public enum QueryTypeEnum {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ public class Dim {
|
|||||||
this.bizName = bizName;
|
this.bizName = bizName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Dim getDefault() {
|
public static Dim getDefault() {
|
||||||
return new Dim("日期", "time", "2023-05-28",
|
return new Dim("日期", "time", "2023-05-28",
|
||||||
Constants.DAY_FORMAT,
|
Constants.DAY_FORMAT,
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ public class QueryStat {
|
|||||||
private String resultCacheKey;
|
private String resultCacheKey;
|
||||||
private String queryOptMode;
|
private String queryOptMode;
|
||||||
|
|
||||||
|
|
||||||
public QueryStat setQueryOptMode(String queryOptMode) {
|
public QueryStat setQueryOptMode(String queryOptMode) {
|
||||||
this.queryOptMode = queryOptMode;
|
this.queryOptMode = queryOptMode;
|
||||||
return this;
|
return this;
|
||||||
@@ -219,7 +218,6 @@ public class QueryStat {
|
|||||||
return JSONObject.parseArray(metrics, String.class);
|
return JSONObject.parseArray(metrics, String.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<String> getDimensionListBizName() {
|
public List<String> getDimensionListBizName() {
|
||||||
return JSONObject.parseArray(dimensions, String.class);
|
return JSONObject.parseArray(dimensions, String.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ public class SchemaItem extends RecordInfo {
|
|||||||
|
|
||||||
private Integer sensitiveLevel = SensitiveLevelEnum.LOW.getCode();
|
private Integer sensitiveLevel = SensitiveLevelEnum.LOW.getCode();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ public class DomainReq extends SchemaItem {
|
|||||||
return String.join(",", viewOrgs);
|
return String.join(",", viewOrgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getAdmin() {
|
public String getAdmin() {
|
||||||
return String.join(",", admins);
|
return String.join(",", admins);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ public class ModelReq extends SchemaItem {
|
|||||||
|
|
||||||
private List<String> adminOrgs = new ArrayList<>();
|
private List<String> adminOrgs = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
public List<Dim> getTimeDimension() {
|
public List<Dim> getTimeDimension() {
|
||||||
if (CollectionUtils.isEmpty(modelDetail.getDimensions())) {
|
if (CollectionUtils.isEmpty(modelDetail.getDimensions())) {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
@@ -50,7 +49,6 @@ public class ModelReq extends SchemaItem {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getViewer() {
|
public String getViewer() {
|
||||||
return String.join(",", viewers);
|
return String.join(",", viewers);
|
||||||
}
|
}
|
||||||
@@ -59,7 +57,6 @@ public class ModelReq extends SchemaItem {
|
|||||||
return String.join(",", viewOrgs);
|
return String.join(",", viewOrgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getAdmin() {
|
public String getAdmin() {
|
||||||
return String.join(",", admins);
|
return String.join(",", admins);
|
||||||
}
|
}
|
||||||
@@ -68,5 +65,4 @@ public class ModelReq extends SchemaItem {
|
|||||||
return String.join(",", adminOrgs);
|
return String.join(",", adminOrgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,5 +23,4 @@ public class SqlExecuteReq {
|
|||||||
return String.format(LIMIT_WRAPPER, sql);
|
return String.format(LIMIT_WRAPPER, sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ public class ModelResp extends SchemaItem {
|
|||||||
|
|
||||||
private Integer metricCnt;
|
private Integer metricCnt;
|
||||||
|
|
||||||
|
|
||||||
public boolean openToAll() {
|
public boolean openToAll() {
|
||||||
return isOpen != null && isOpen == 1;
|
return isOpen != null && isOpen == 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ public class QueryMultiStructReq {
|
|||||||
|
|
||||||
List<QueryStructReq> queryStructReqs;
|
List<QueryStructReq> queryStructReqs;
|
||||||
|
|
||||||
|
|
||||||
public String toCustomizedString() {
|
public String toCustomizedString() {
|
||||||
return JSONObject.toJSONString(queryStructReqs);
|
return JSONObject.toJSONString(queryStructReqs);
|
||||||
}
|
}
|
||||||
@@ -21,4 +20,5 @@ public class QueryMultiStructReq {
|
|||||||
public String generateCommandMd5() {
|
public String generateCommandMd5() {
|
||||||
return DigestUtils.md5Hex(this.toCustomizedString());
|
return DigestUtils.md5Hex(this.toCustomizedString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ public class QueryStructReq {
|
|||||||
return stringBuilder.toString();
|
return stringBuilder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String generateCommandMd5() {
|
public String generateCommandMd5() {
|
||||||
return DigestUtils.md5Hex(this.toCustomizedString());
|
return DigestUtils.md5Hex(this.toCustomizedString());
|
||||||
}
|
}
|
||||||
@@ -178,7 +177,6 @@ public class QueryStructReq {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convert queryStructReq to QueryS2QLReq
|
* convert queryStructReq to QueryS2QLReq
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ public class MaterializationConfServiceImpl implements MaterializationConfServic
|
|||||||
return materializationRespList.get(0);
|
return materializationRespList.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean addMaterializationElementConf(MaterializationElementReq materializationElementReq, User user) {
|
public Boolean addMaterializationElementConf(MaterializationElementReq materializationElementReq, User user) {
|
||||||
log.info("materializationElementReq:{}, user:{}", JsonUtil.toString(materializationElementReq),
|
log.info("materializationElementReq:{}, user:{}", JsonUtil.toString(materializationElementReq),
|
||||||
@@ -292,7 +291,6 @@ public class MaterializationConfServiceImpl implements MaterializationConfServic
|
|||||||
return materializationElementRepository.cleanMaterializationElement(materializationId);
|
return materializationElementRepository.cleanMaterializationElement(materializationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MaterializationElementModelResp> getMaterializationElementModels(Long materializationId, User user) {
|
public List<MaterializationElementModelResp> getMaterializationElementModels(Long materializationId, User user) {
|
||||||
MaterializationResp materializationResp = materializationRepository.getMaterialization(materializationId);
|
MaterializationResp materializationResp = materializationRepository.getMaterialization(materializationId);
|
||||||
@@ -473,7 +471,6 @@ public class MaterializationConfServiceImpl implements MaterializationConfServic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getDataSourceMeasure(List<MeasureResp> measureRespList, String bizName) {
|
private String getDataSourceMeasure(List<MeasureResp> measureRespList, String bizName) {
|
||||||
if (!CollectionUtils.isEmpty(measureRespList)) {
|
if (!CollectionUtils.isEmpty(measureRespList)) {
|
||||||
Optional<MeasureResp> measure = measureRespList.stream()
|
Optional<MeasureResp> measure = measureRespList.stream()
|
||||||
@@ -485,5 +482,4 @@ public class MaterializationConfServiceImpl implements MaterializationConfServic
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,6 @@ public interface MaterializationConfService {
|
|||||||
|
|
||||||
List<MaterializationResp> getMaterializationResp(MaterializationFilter filter, User user);
|
List<MaterializationResp> getMaterializationResp(MaterializationFilter filter, User user);
|
||||||
|
|
||||||
|
|
||||||
Boolean addMaterializationElementConf(MaterializationElementReq materializationElementReq, User user);
|
Boolean addMaterializationElementConf(MaterializationElementReq materializationElementReq, User user);
|
||||||
|
|
||||||
Boolean updateMaterializationElementConf(MaterializationElementReq materializationElementReq, User user);
|
Boolean updateMaterializationElementConf(MaterializationElementReq materializationElementReq, User user);
|
||||||
@@ -40,5 +39,4 @@ public interface MaterializationConfService {
|
|||||||
|
|
||||||
Long getSourceIdByMeasure(List<MeasureResp> measureRespList, String bizName);
|
Long getSourceIdByMeasure(List<MeasureResp> measureRespList, String bizName);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,5 +23,4 @@ public interface MaterializationRecordService {
|
|||||||
List<MaterializationRecordResp> fetchMaterializationDate(List<Long> materializationIds, String elementName,
|
List<MaterializationRecordResp> fetchMaterializationDate(List<Long> materializationIds, String elementName,
|
||||||
String startTime, String endTime);
|
String startTime, String endTime);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user