Explorar el Código

增加设备分页

hechunping hace 1 año
padre
commit
7b166c59f1

+ 12 - 0
device-api-service/src/main/java/com/xy/service/DeviceInfoServiceImpl.java

@@ -90,6 +90,16 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
     private final String keyPrefix = "device:history:";
 
 
+    @Override
+    @ApiOperation("分页")
+    public R<PageBean<DeviceInfoDto.Vo>> pageSingle(DeviceInfoDto.PageSingle dto) {
+        PageBean pageBean = dto.getPage();
+        LambdaQueryWrapper<DeviceInfo> lqw = new MybatisPlusQuery().eqWrapper(dto,DeviceInfo.class)
+                .build();
+        IPage<DeviceInfo> iPage = page(toIPage(pageBean), lqw);
+        return R.ok(toPageBean(DeviceInfoDto.Vo.class, iPage));
+    }
+
     @Override
     @ApiOperation("对象查询")
     public R<DeviceInfoDto.Vo> obj(DeviceInfoDto.Obj obj) {
@@ -262,6 +272,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
     }
 
 
+
+
     @Override
     @ApiOperation("更新商户点位")
     public R updatePlace(@RequestBody @Validated DeviceInfoDto.UpdatePlace updatePlace) {

+ 8 - 0
device-api/src/main/java/com/xy/dto/DeviceInfoDto.java

@@ -143,6 +143,14 @@ public class DeviceInfoDto {
         private DeviceRegisterDto.Vo deviceRegister;
     }
 
+    @Data
+    @Accessors(chain = true)
+    public static class PageSingle extends Vo{
+        @NotNull(message = "分页对象不能空")
+        @ApiModelProperty(value = "分页对象", required = true)
+        private PageBean page;
+    }
+
     @Data
     @Accessors(chain = true)
     public static class Page extends Vo {

+ 3 - 0
device-api/src/main/java/com/xy/service/DeviceInfoService.java

@@ -91,6 +91,9 @@ public interface DeviceInfoService {
     @PostMapping("updateLine")
     R updateLine(@RequestBody @Validated DeviceInfoDto.UpdateLine updateLine);
 
+    @PostMapping("pageSingle")
+    R<PageBean<DeviceInfoDto.Vo>> pageSingle(@RequestBody DeviceInfoDto.PageSingle dto);
+
     /**
      * 更新商户点位
      *