|
|
@@ -1,4 +1,4 @@
|
|
|
-package com.zhongshu.iot.server.core.controller.iot.openAPI;
|
|
|
+package com.zhongshu.iot.server.core.controller.openAPi.iotThing;
|
|
|
|
|
|
import com.github.microservice.busInfoModel.thing.IotThing2DeviceModel;
|
|
|
import com.github.microservice.busInfoModel.thing.IotThing2DeviceSearch;
|
|
|
@@ -10,12 +10,11 @@ import com.github.microservice.staticVariable.OpenApiMark;
|
|
|
import com.zhongshu.iot.server.core.service.iot.IotThing2DeviceService;
|
|
|
import com.zhongshu.iot.server.core.service.iot.IotThingService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
-import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
-import org.springframework.data.web.PageableDefault;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -23,16 +22,16 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
/**
|
|
|
- * 物模型管理
|
|
|
+ * 物模型相关的 openApi 接口
|
|
|
*
|
|
|
* @author TRX
|
|
|
- * @date 2024/3/21
|
|
|
+ * @date 2024/11/11
|
|
|
*/
|
|
|
-@RequestMapping("/" + OpenApiMark.iotOpenAPI + "/manager/v1/thing")
|
|
|
+@RequestMapping("/" + OpenApiMark.iotOpenAPI + "/manager/v1/iotThing")
|
|
|
@RestController
|
|
|
@Validated
|
|
|
-@Tag(name = "openAPI-物模型-物模型管理")
|
|
|
-public class IotThingOpenAPIController {
|
|
|
+@Tag(name = "openAPI-物模型")
|
|
|
+public class IotThingOpenApiController {
|
|
|
|
|
|
@Autowired
|
|
|
private IotThingService iotThingService;
|
|
|
@@ -43,8 +42,8 @@ public class IotThingOpenAPIController {
|
|
|
@Operation(summary = "物模型列表-分页查询")
|
|
|
@RequestMapping(value = {"page"}, method = {RequestMethod.POST})
|
|
|
public ResultContent<Page<IotThingModel>> page(
|
|
|
- @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
|
|
|
- @Parameter(required = false) IotThingSearch param) {
|
|
|
+ @RequestBody IotThingSearch param) {
|
|
|
+ Pageable pageable = PageRequest.of(param.getNumber(), param.getSize());
|
|
|
return iotThingService.page(pageable, param);
|
|
|
}
|
|
|
|
|
|
@@ -54,13 +53,15 @@ public class IotThingOpenAPIController {
|
|
|
return iotThingService.getDetail(param.getId());
|
|
|
}
|
|
|
|
|
|
- //--------------------------------物模型设备信息 start-----------------
|
|
|
+ //---------------------------物模型设备信息 start---------------
|
|
|
|
|
|
@Operation(summary = "物模型设备列表-分页查询")
|
|
|
@RequestMapping(value = {"pageDevice"}, method = {RequestMethod.POST})
|
|
|
public ResultContent<Page<IotThing2DeviceModel>> pageDevice(
|
|
|
- @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
|
|
|
- @Parameter(required = false) IotThing2DeviceSearch param) {
|
|
|
+ @RequestBody IotThing2DeviceSearch param) {
|
|
|
+ Pageable pageable = PageRequest.of(param.getNumber(), param.getSize());
|
|
|
return iotThing2DeviceService.page(pageable, param);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|