|
@@ -8,6 +8,7 @@ import com.middle.platform.manage.biz.service.IotProductService;
|
|
|
import com.middle.platform.manage.biz.service.IotUrlService;
|
|
import com.middle.platform.manage.biz.service.IotUrlService;
|
|
|
import jakarta.validation.Valid;
|
|
import jakarta.validation.Valid;
|
|
|
import jakarta.validation.constraints.NotBlank;
|
|
import jakarta.validation.constraints.NotBlank;
|
|
|
|
|
+import jakarta.validation.constraints.NotNull;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -33,7 +34,7 @@ public class IotProductController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
|
public Result<Object> list(@RequestBody @Validated ProductPage productPage) {
|
|
public Result<Object> list(@RequestBody @Validated ProductPage productPage) {
|
|
|
- return Result.ok(iotProductService.pageQuery(productPage));
|
|
|
|
|
|
|
+ return Result.ok(iotProductService.pageQuery(productPage), "查询成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -44,7 +45,7 @@ public class IotProductController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/save")
|
|
@PostMapping("/save")
|
|
|
public Result<Object> save(@RequestBody @Validated IotProductPara iotProductPara) {
|
|
public Result<Object> save(@RequestBody @Validated IotProductPara iotProductPara) {
|
|
|
- return Result.ok(iotProductService.save(iotProductPara));
|
|
|
|
|
|
|
+ return Result.ok(iotProductService.save(iotProductPara), "保存成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -58,8 +59,30 @@ public class IotProductController {
|
|
|
return Result.ok(iotProductService.remove(id), "删除成功");
|
|
return Result.ok(iotProductService.remove(id), "删除成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 产品详情
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/detail")
|
|
|
|
|
+ public Result<Object> detail(@RequestParam("id") @NotBlank(message = "id不能为空") Long id) {
|
|
|
|
|
+ return Result.ok(iotProductService.detail(id), "查询成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//物模型
|
|
//物模型
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询产品关联的物模型
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param productId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/getMod")
|
|
|
|
|
+ public Result<Object> getMod(@RequestParam("productId") @NotBlank(message = "id不能为空") Long productId) {
|
|
|
|
|
+ return Result.ok(iotModService.queryMod(productId), "查询成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 保存物模型
|
|
* 保存物模型
|
|
|
*
|
|
*
|
|
@@ -81,6 +104,17 @@ public class IotProductController {
|
|
|
return Result.ok(iotCloudService.save(iotCloudPara), "保存成功");
|
|
return Result.ok(iotCloudService.save(iotCloudPara), "保存成功");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询产品关联的云函数
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param productId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/getCloud")
|
|
|
|
|
+ public Result<Object> getCloud(@RequestParam("productId") @NotBlank(message = "id不能为空") Long productId) {
|
|
|
|
|
+ return Result.ok(iotCloudService.getCloud(productId), "查询成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 云函数测试
|
|
* 云函数测试
|
|
|
*
|
|
*
|
|
@@ -94,6 +128,18 @@ public class IotProductController {
|
|
|
|
|
|
|
|
//通信地址
|
|
//通信地址
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询产品关联的地址
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param productId
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/getUrl")
|
|
|
|
|
+ public Result<Object> getUrl(@RequestParam("productId") @NotBlank(message = "id不能为空") Long productId,
|
|
|
|
|
+ @RequestParam("type") @NotNull(message = "类型不能为空") Integer type) {
|
|
|
|
|
+ return Result.ok(iotUrlService.getUrl(productId,type), "查询成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 产品对应的通信地址配置
|
|
* 产品对应的通信地址配置
|
|
|
*
|
|
*
|