|
@@ -4,56 +4,71 @@ import com.bosshand.virgo.core.response.Response;
|
|
|
import com.bosshand.virgo.ringzle.model.Device;
|
|
|
import com.bosshand.virgo.ringzle.model.DeviceData;
|
|
|
import com.bosshand.virgo.ringzle.service.DeviceService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("device")
|
|
|
+@Api(tags = {"设备管理"})
|
|
|
public class DeviceCon {
|
|
|
|
|
|
@Autowired
|
|
|
private DeviceService deviceService;
|
|
|
|
|
|
- @ApiOperation(value = "查询设备", notes = "查询设备")
|
|
|
+ @ApiOperation(value = "查询设备")
|
|
|
@RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
|
public Response getList(@RequestBody Device device) {
|
|
|
return Response.ok(deviceService.getList(device));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "查询多个设备数据", notes = "查询多个设备数据")
|
|
|
- @RequestMapping(value = {"/","/{ids}"}, method = RequestMethod.GET)
|
|
|
+ @ApiOperation(value = "查询多个设备数据")
|
|
|
+ @RequestMapping(value = {"/{ids}"}, method = RequestMethod.GET)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "ids", value = "设备ids用,分割"),
|
|
|
+ })
|
|
|
public Response getDeviceData(@PathVariable(required = false) String ids) {
|
|
|
return Response.ok(deviceService.getListDeviceData(ids));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "新增设备数据", notes = "新增设备数据")
|
|
|
+ @ApiOperation(value = "新增设备数据")
|
|
|
@RequestMapping(value = "/deviceData", method = RequestMethod.POST)
|
|
|
public Response addDeviceData(@RequestBody DeviceData DeviceData) {
|
|
|
return Response.ok(deviceService.saveDeviceData(DeviceData));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "查询构件上设备", notes = "查询设备")
|
|
|
+ @ApiOperation(value = "查询构件上设备")
|
|
|
@RequestMapping(value = "/{projectId}/{bimIntegrateId}/{elementId}", method = RequestMethod.GET)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "projectId", value = "项目id"),
|
|
|
+ @ApiImplicitParam(name = "bimIntegrateId", value = "BIM模型集成id"),
|
|
|
+ @ApiImplicitParam(name = "elementId", value = "构件id")
|
|
|
+ })
|
|
|
public Response getListByElement(@PathVariable long projectId, @PathVariable String bimIntegrateId, @PathVariable String elementId) {
|
|
|
return Response.ok(deviceService.getListByElement(projectId,bimIntegrateId,elementId));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "新增设备", notes = "新增设备")
|
|
|
+ @ApiOperation(value = "新增设备")
|
|
|
@RequestMapping(value = "", method = RequestMethod.POST)
|
|
|
public Response add(@RequestBody Device device) {
|
|
|
deviceService.add(device);
|
|
|
return Response.ok();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "删除设备", notes = "删除设备")
|
|
|
+ @ApiOperation(value = "删除设备")
|
|
|
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "id", value = "设备id"),
|
|
|
+ })
|
|
|
public Response del(@PathVariable int id) {
|
|
|
deviceService.delete(id);
|
|
|
return Response.ok();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "修改设备", notes = "修改设备")
|
|
|
+ @ApiOperation(value = "更新设备")
|
|
|
@RequestMapping(value = "", method = RequestMethod.PUT)
|
|
|
public Response update(@RequestBody Device device) {
|
|
|
deviceService.update(device);
|