dcs 3 天之前
父節點
當前提交
7a4a9b5bfa

+ 3 - 3
virgo.api/src/main/java/com/bosshand/virgo/api/workark/controller/V0Controller.java

@@ -17,7 +17,7 @@ public class V0Controller {
     @ApiOperation(value = "创建项目")
     @PostMapping({"/projects"})
     public Response projects(@RequestBody JSONObject jsonObject) {
-        String sync = OkHttpUtils.builder().url("https://api.v0.dev/v1/projects")
+        String sync = OkHttpUtils.builder().url("https://api.v0.dev/projects")
                 .addParam(jsonObject)
                 .addHeader("Content-Type", "application/json; charset=utf-8")
                 .addHeader("Authorization", "Bearer v1:OdiTOd4JMzwdd6mQ4FIo4QTh:r16t2Epsy3eR51SmnPoKDvNN")
@@ -30,7 +30,7 @@ public class V0Controller {
     @ApiOperation(value = "创建聊天")
     @PostMapping({"/chats"})
     public Response chats(@RequestBody JSONObject jsonObject) {
-        String sync = OkHttpUtils.builder().url("https://api.v0.dev/v1/chats")
+        String sync = OkHttpUtils.builder().url("https://api.v0.dev/chats")
                 .addParam(jsonObject)
                 // 也可以添加多个
                 .addHeader("Content-Type", "application/json; charset=utf-8")
@@ -46,7 +46,7 @@ public class V0Controller {
             @ApiImplicitParam(name = "chatId", value = "要向其发送消息的聊天的唯一标识符")
     })
     public Response chatsMessages(@RequestBody JSONObject jsonObject, @PathVariable String chatId) {
-        String sync = OkHttpUtils.builder().url("https://api.v0.dev/v1/chats/"+chatId+"/messages")
+        String sync = OkHttpUtils.builder().url("https://api.v0.dev/chats/"+chatId+"/messages")
                 .addParam(jsonObject)
                 // 也可以添加多个
                 .addHeader("Content-Type", "application/json; charset=utf-8")

+ 23 - 8
virgo.ringzle/src/main/java/com/bosshand/virgo/ringzle/controller/DeviceCon.java

@@ -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);

+ 6 - 1
virgo.ringzle/src/main/java/com/bosshand/virgo/ringzle/controller/IotEntityBimCon.java

@@ -5,6 +5,8 @@ import com.bosshand.virgo.core.response.Response;
 import com.bosshand.virgo.ringzle.model.IotEntityBim;
 import com.bosshand.virgo.ringzle.service.IotEntityBimService;
 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.*;
@@ -20,7 +22,7 @@ public class IotEntityBimCon {
     IotEntityBimService iotEntityBimService;
 
     @PostMapping({""})
-    @ApiOperation("批量保存")
+    @ApiOperation("批量新增")
     public Response batchSave(@RequestBody List<IotEntityBim> list) {
         iotEntityBimService.batchSave(list);
         return Response.ok();
@@ -28,6 +30,9 @@ public class IotEntityBimCon {
 
     @DeleteMapping({"/{id}"})
     @ApiOperation("删除")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "记录id"),
+    })
     public Response del(@PathVariable int id) {
         iotEntityBimService.delete(id);
         return Response.ok();