| | |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.sxkj.common.model.GenericConverter; |
| | | import org.sxkj.fw.device.dto.FwDeviceDTO; |
| | | import org.sxkj.fw.device.entity.FwDeviceEntity; |
| | | import org.sxkj.fw.device.excel.FwDeviceExcel; |
| | | import org.sxkj.fw.device.param.FwDeviceDetailParam; |
| | | import org.sxkj.fw.device.param.FwDevicePageParam; |
| | | import org.sxkj.fw.device.service.IFwDeviceService; |
| | | import org.sxkj.fw.device.vo.FwDeviceVO; |
| | | import org.sxkj.fw.device.wrapper.FwDeviceWrapper; |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入fwDevice") |
| | | public R<FwDeviceVO> detail(FwDeviceDTO fwDevice) { |
| | | FwDeviceEntity detail = fwDeviceService.getOne(Condition.getQueryWrapper(FwDeviceWrapper.build().entityDTO(fwDevice))); |
| | | public R<FwDeviceVO> detail(@Valid FwDeviceDetailParam fwDevice) { |
| | | FwDeviceEntity detail = fwDeviceService.getOne(Condition.getQueryWrapper(GenericConverter.convert(fwDevice, FwDeviceEntity.class))); |
| | | |
| | | if (detail == null) { |
| | | return R.fail("该设备不存在"); |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入fwDevice") |
| | | public R<IPage<FwDeviceVO>> page(FwDeviceDTO fwDevice, Query query) { |
| | | IPage<FwDeviceEntity> pages = fwDeviceService.selectFwDevicePage(Condition.getPage(query), fwDevice); |
| | | public R<IPage<FwDeviceVO>> page(FwDevicePageParam fwDevice, Query query) { |
| | | IPage<FwDeviceEntity> pages = fwDeviceService.selectFwDevicePage(Condition.getPage(query), GenericConverter.convert(fwDevice, FwDeviceDTO.class)); |
| | | return R.data(FwDeviceWrapper.build().pageVO(pages)); |
| | | } |
| | | |