1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
@GetMapping(params = "search=accurate") @Secured(action = ActionTypes.READ, signType = SignType.CONFIG) public Page<ConfigInfo> searchConfig(@RequestParam("dataId") String dataId, @RequestParam("group") String group, @RequestParam(value = "appName", required = false) String appName, @RequestParam(value = "tenant", required = false, defaultValue = StringUtils.EMPTY) String tenant, @RequestParam(value = "config_tags", required = false) String configTags, @RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize) { Map<String, Object> configAdvanceInfo = new HashMap<>(100); if (StringUtils.isNotBlank(appName)) { configAdvanceInfo.put("appName", appName); } if (StringUtils.isNotBlank(configTags)) { configAdvanceInfo.put("config_tags", configTags); } try { return configInfoPersistService.findConfigInfo4Page(pageNo, pageSize, dataId, group, tenant, configAdvanceInfo); } catch (Exception e) { String errorMsg = "serialize page error, dataId=" + dataId + ", group=" + group; LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } }
@GetMapping(params = "search=blur") @Secured(action = ActionTypes.READ, signType = SignType.CONFIG) public Page<ConfigInfo> fuzzySearchConfig(@RequestParam("dataId") String dataId, @RequestParam("group") String group, @RequestParam(value = "appName", required = false) String appName, @RequestParam(value = "tenant", required = false, defaultValue = StringUtils.EMPTY) String tenant, @RequestParam(value = "config_tags", required = false) String configTags, @RequestParam("pageNo") int pageNo, @RequestParam("pageSize") int pageSize) { MetricsMonitor.getFuzzySearchMonitor().incrementAndGet(); Map<String, Object> configAdvanceInfo = new HashMap<>(50); if (StringUtils.isNotBlank(appName)) { configAdvanceInfo.put("appName", appName); } if (StringUtils.isNotBlank(configTags)) { configAdvanceInfo.put("config_tags", configTags); } try { return configInfoPersistService.findConfigInfoLike4Page(pageNo, pageSize, dataId, group, tenant, configAdvanceInfo); } catch (Exception e) { String errorMsg = "serialize page error, dataId=" + dataId + ", group=" + group; LOGGER.error(errorMsg, e); throw new RuntimeException(errorMsg, e); } }
|