|
@@ -0,0 +1,50 @@
|
|
|
+package com.fdkankan.web.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.common.api.BaseController;
|
|
|
+import com.fdkankan.common.exception.BaseRuntimeException;
|
|
|
+import com.fdkankan.common.model.ViewResult;
|
|
|
+import com.fdkankan.scene.util.CreateObjUtil;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.log4j.Log4j2;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+@Log4j2
|
|
|
+@Api(tags = "test")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/api/test")
|
|
|
+public class TestController extends BaseController {
|
|
|
+
|
|
|
+ @ApiOperation(value = "", hidden = true)
|
|
|
+ @GetMapping("/test1")
|
|
|
+ public ViewResult test1() throws Exception{
|
|
|
+ String json = "{\"data\":[{\"blend_fov\":\"7\",\"id\":\"2\",\"value\":\"1.31156\"},{\"blend_fov\":\"7\",\"id\":\"4\",\"value\":\"0.890266\"}],\"upPath\":\"https://4dkk.4dage.com/data/datat-kryAqiX/Up.xml\",\"version\":3}";
|
|
|
+ JSONObject scenejson = JSONObject.parseObject(json);
|
|
|
+ System.out.println(scenejson);
|
|
|
+ Object data = scenejson.get("data");
|
|
|
+ JSONArray jsonArray = (JSONArray) data;
|
|
|
+ Object jsonObj = jsonArray.stream().filter(j -> "2".equals(((JSONObject)j).get("id")))
|
|
|
+ .findAny().orElseThrow(() -> new BaseRuntimeException("json数据data里找不到对应记录"));
|
|
|
+
|
|
|
+ ((JSONObject)jsonObj).put("show", true);
|
|
|
+
|
|
|
+ System.out.println(scenejson);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("获取")
|
|
|
+ @GetMapping("/test2")
|
|
|
+ public void test2() throws Exception {
|
|
|
+ String url = "/mnt/4Dkankan/scene/video/videoHDdAupM0Px/0.mp4";
|
|
|
+ String ip = "127.0.0.1";
|
|
|
+ CreateObjUtil.generateShareVideo(url, ip);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|