|
@@ -2,10 +2,10 @@ package com.zhongshu.iot.server.core.controller.iot;
|
|
|
|
|
|
|
|
import com.github.microservice.auth.security.annotations.ResourceAuth;
|
|
import com.github.microservice.auth.security.annotations.ResourceAuth;
|
|
|
import com.github.microservice.auth.security.type.AuthType;
|
|
import com.github.microservice.auth.security.type.AuthType;
|
|
|
|
|
+import com.github.microservice.net.ResultContent;
|
|
|
import com.zhongshu.iot.client.model.baseParam.NameModel;
|
|
import com.zhongshu.iot.client.model.baseParam.NameModel;
|
|
|
import com.zhongshu.iot.client.model.iot.*;
|
|
import com.zhongshu.iot.client.model.iot.*;
|
|
|
import com.zhongshu.iot.server.core.service.iot.IotServiceImpl;
|
|
import com.zhongshu.iot.server.core.service.iot.IotServiceImpl;
|
|
|
-import com.github.microservice.net.ResultContent;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
@@ -15,10 +15,7 @@ import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.web.PageableDefault;
|
|
import org.springframework.data.web.PageableDefault;
|
|
|
import org.springframework.util.Assert;
|
|
import org.springframework.util.Assert;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
@@ -57,14 +54,17 @@ public class IotController {
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "删除模版")
|
|
@Operation(summary = "删除模版")
|
|
|
@RequestMapping(value = "deleteTemplate", method = {RequestMethod.GET})
|
|
@RequestMapping(value = "deleteTemplate", method = {RequestMethod.GET})
|
|
|
- public ResultContent deleteTemplate(@Parameter(name = "id", description = "数据id") String id) {
|
|
|
|
|
|
|
+ public ResultContent deleteTemplate(
|
|
|
|
|
+ @RequestParam(name = "id") @Parameter(name = "id", description = "数据id") String id) {
|
|
|
return iotService.deleteTemplate(id);
|
|
return iotService.deleteTemplate(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "查询模版详情")
|
|
@Operation(summary = "查询模版详情")
|
|
|
@RequestMapping(value = "getIotTemplate", method = {RequestMethod.GET})
|
|
@RequestMapping(value = "getIotTemplate", method = {RequestMethod.GET})
|
|
|
- public ResultContent<IotTemplateModel> getIotTemplate(@Parameter(name = "id", description = "数据id") String id) {
|
|
|
|
|
|
|
+ public ResultContent<IotTemplateModel> getIotTemplate(
|
|
|
|
|
+ @RequestParam(name = "id")
|
|
|
|
|
+ @Parameter(name = "id", description = "数据id") String id) {
|
|
|
return iotService.getIotTemplate(id);
|
|
return iotService.getIotTemplate(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -72,16 +72,14 @@ public class IotController {
|
|
|
@Operation(summary = "得到设备的物模型列表")
|
|
@Operation(summary = "得到设备的物模型列表")
|
|
|
@RequestMapping(value = "getDeviceTemplateList", method = {RequestMethod.GET})
|
|
@RequestMapping(value = "getDeviceTemplateList", method = {RequestMethod.GET})
|
|
|
public ResultContent<List<IotTemplateModel>> getDeviceTemplateList(
|
|
public ResultContent<List<IotTemplateModel>> getDeviceTemplateList(
|
|
|
- @Parameter(name = "deviceId", description = "设备ID") String deviceId
|
|
|
|
|
- ) {
|
|
|
|
|
|
|
+ @RequestParam(name = "deviceId") @Parameter(name = "deviceId", description = "设备ID") String deviceId) {
|
|
|
return iotService.getDeviceTemplateList(deviceId);
|
|
return iotService.getDeviceTemplateList(deviceId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "修改模型名称")
|
|
@Operation(summary = "修改模型名称")
|
|
|
@RequestMapping(value = "updateIotTemplateName", method = {RequestMethod.POST})
|
|
@RequestMapping(value = "updateIotTemplateName", method = {RequestMethod.POST})
|
|
|
- public ResultContent<List<IotTemplateModel>> updateIotTemplateName(@RequestBody NameModel param
|
|
|
|
|
- ) {
|
|
|
|
|
|
|
+ public ResultContent<List<IotTemplateModel>> updateIotTemplateName(@RequestBody NameModel param) {
|
|
|
return iotService.updateIotTemplateName(param);
|
|
return iotService.updateIotTemplateName(param);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -115,14 +113,18 @@ public class IotController {
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "删除物模型")
|
|
@Operation(summary = "删除物模型")
|
|
|
@RequestMapping(value = "deleteIotMain", method = {RequestMethod.GET})
|
|
@RequestMapping(value = "deleteIotMain", method = {RequestMethod.GET})
|
|
|
- public ResultContent deleteIotMain(@Parameter(name = "id", description = "数据id") String id) {
|
|
|
|
|
|
|
+ public ResultContent deleteIotMain(
|
|
|
|
|
+ @RequestParam(name = "id")
|
|
|
|
|
+ @Parameter(name = "id", description = "数据id") String id) {
|
|
|
return iotService.deleteIotMain(id);
|
|
return iotService.deleteIotMain(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "查询物模型")
|
|
@Operation(summary = "查询物模型")
|
|
|
@RequestMapping(value = "getIotMain", method = {RequestMethod.GET})
|
|
@RequestMapping(value = "getIotMain", method = {RequestMethod.GET})
|
|
|
- public ResultContent<IotMainModel> getIotMain(@Parameter(name = "id", description = "数据id") String id) {
|
|
|
|
|
|
|
+ public ResultContent<IotMainModel> getIotMain(
|
|
|
|
|
+ @RequestParam(name = "id")
|
|
|
|
|
+ @Parameter(name = "id", description = "数据id") String id) {
|
|
|
return iotService.getIotMain(id);
|
|
return iotService.getIotMain(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -149,14 +151,18 @@ public class IotController {
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "删除Topic", hidden = true)
|
|
@Operation(summary = "删除Topic", hidden = true)
|
|
|
@RequestMapping(value = "deleteIotTopic", method = {RequestMethod.GET})
|
|
@RequestMapping(value = "deleteIotTopic", method = {RequestMethod.GET})
|
|
|
- public ResultContent deleteIotTopic(@Parameter(name = "id", description = "数据id") String id) {
|
|
|
|
|
|
|
+ public ResultContent deleteIotTopic(
|
|
|
|
|
+ @RequestParam(name = "id")
|
|
|
|
|
+ @Parameter(name = "id", description = "数据id") String id) {
|
|
|
return iotService.deleteIotTopic(id);
|
|
return iotService.deleteIotTopic(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "查询Topic", hidden = true)
|
|
@Operation(summary = "查询Topic", hidden = true)
|
|
|
@RequestMapping(value = "getIotTopic", method = {RequestMethod.GET})
|
|
@RequestMapping(value = "getIotTopic", method = {RequestMethod.GET})
|
|
|
- public ResultContent<IotTopicModel> getIotTopic(@Parameter(name = "id", description = "数据id") String id) {
|
|
|
|
|
|
|
+ public ResultContent<IotTopicModel> getIotTopic(
|
|
|
|
|
+ @RequestParam(name = "id")
|
|
|
|
|
+ @Parameter(name = "id", description = "数据id") String id) {
|
|
|
return iotService.getIotTopic(id);
|
|
return iotService.getIotTopic(id);
|
|
|
}
|
|
}
|
|
|
|
|
|