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