处理返回数据的格式为key:value结构

List hthSharedConfigList = this.list(new LambdaQueryWrapper().in(HthAppConfig::getConfigKey, keys));
//处理返回成key:value形式
Map keyValueMap = hthSharedConfigList.stream()
.collect(Collectors.toMap(HthAppConfig::getConfigKey,
                          config -> Optional.ofNullable(config.getConfigValue()).orElse("")));
return AjaxResult.success(keyValueMap);

你可能感兴趣的:(服务器,linux,数据库)