diff --git a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysConfigDataImpl.java b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysConfigDataImpl.java index d055db89..c1070fab 100644 --- a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysConfigDataImpl.java +++ b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysConfigDataImpl.java @@ -104,9 +104,12 @@ public class SysConfigDataImpl implements ISysConfigData, IJPACommData tbSysConfig.configKey.eq(data.getConfigKey())) + .and(StringUtils.isNotBlank(data.getConfigKey()), () -> tbSysConfig.configKey.eq(data.getConfigKey())) .build(); - TbSysConfig tbSysConfig = baseRepository.findOne(predicate).orElseThrow(() -> new BizException(ErrCode.DATA_NOT_EXIST)); + TbSysConfig tbSysConfig = baseRepository.findOne(predicate).orElse(null); + if(Objects.isNull(tbSysConfig)){ + return null; + } return MapstructUtils.convert(tbSysConfig, SysConfig.class); } diff --git a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysLogininfoDataImpl.java b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysLogininfoDataImpl.java index 529d949f..cb9a0149 100644 --- a/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysLogininfoDataImpl.java +++ b/iot-common/iot-common-dao/iot-data-serviceImpl-rdb/src/main/java/cc/iotkit/data/service/SysLogininfoDataImpl.java @@ -55,7 +55,7 @@ public class SysLogininfoDataImpl implements ISysLogininforData, IJPACommData findAll(PageRequest pageRequest) { - return PageBuilder.toPaging(logininfoRepository.findAll(genPredicate(pageRequest.getData()), PageBuilder.toPageable(pageRequest))); + return PageBuilder.toPaging(logininfoRepository.findAll(genPredicate(pageRequest.getData()), PageBuilder.toPageable(pageRequest))).to(SysLogininfor.class); } @Override diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysOssConfigController.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysOssConfigController.java index 695e00f3..8e4f2476 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysOssConfigController.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysOssConfigController.java @@ -50,14 +50,12 @@ public class SysOssConfigController extends BaseController { /** * 获取对象存储配置详细信息 * - * @param ossConfigId OSS配置ID */ @ApiOperation(value = "获取对象存储配置详细信息", notes = "获取对象存储配置详细信息") @SaCheckPermission("system:oss:query") - @PostMapping("/{ossConfigId}") - public SysOssConfigVo getInfo(@NotNull(message = "主键不能为空") - @PathVariable Long ossConfigId) { - return ossConfigService.queryById(ossConfigId); + @PostMapping("/getDetail") + public SysOssConfigVo getInfo(@Validated @RequestBody Request bo) { + return ossConfigService.queryById(bo.getData()); } /** diff --git a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysOssConfigBo.java b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysOssConfigBo.java index b4fa1a73..dde0fb75 100644 --- a/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysOssConfigBo.java +++ b/iot-module/iot-system/src/main/java/cc/iotkit/system/dto/bo/SysOssConfigBo.java @@ -28,7 +28,7 @@ public class SysOssConfigBo extends BaseDto { * 主建 */ @NotNull(message = "主建不能为空", groups = {EditGroup.class}) - private Long ossConfigId; + private Long id; /** * 配置key