diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java index 1cc41b35..3fb76f7d 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysConfigController.java @@ -68,8 +68,8 @@ public class SysConfigController extends BaseController { @ApiOperation("根据参数键名查询参数值") @PostMapping(value = "/getConfigKey") - public void getConfigKey(@RequestBody @Validated Request request) { - configService.selectConfigByKey(request.getData()); + public String getConfigKey(@RequestBody @Validated Request request) { + return configService.selectConfigByKey(request.getData()); } diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysConfigServiceImpl.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysConfigServiceImpl.java index eb8d9114..1e152362 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysConfigServiceImpl.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysConfigServiceImpl.java @@ -61,9 +61,7 @@ public class SysConfigServiceImpl implements ISysConfigService, ConfigService { */ @Override public String selectConfigByKey(String configKey) { - SysConfig data = new SysConfig(); - data.setConfigKey(configKey); - SysConfig sysConfig = sysConfigData.findOneByCondition(data); + SysConfig sysConfig = sysConfigData.findByConfigKey(configKey); if (ObjectUtil.isNotNull(sysConfig)) { return sysConfig.getConfigValue(); }