|
@@ -0,0 +1,51 @@
|
|
|
+package com.fdkankan.scene.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fdkankan.scene.annotation.CheckPermit;
|
|
|
+import com.fdkankan.scene.entity.SceneMarkShape;
|
|
|
+import com.fdkankan.scene.entity.SceneShapeEnum;
|
|
|
+import com.fdkankan.scene.service.ISceneMarkShapeService;
|
|
|
+import com.fdkankan.scene.service.SceneShapeEnumService;
|
|
|
+import com.fdkankan.scene.vo.SceneMarkShapeParamVO;
|
|
|
+import com.fdkankan.web.response.ResultData;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/service/scene/edit/ai")
|
|
|
+public class SceneEditAiController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneMarkShapeService sceneMarkShapeService;
|
|
|
+ @Autowired
|
|
|
+ private SceneShapeEnumService sceneShapeEnumService;
|
|
|
+
|
|
|
+ @CheckPermit
|
|
|
+ @PostMapping("/box4/getInfos")
|
|
|
+ public ResultData box4GetInfos(@RequestBody @Validated SceneMarkShapeParamVO param) {
|
|
|
+ List<SceneMarkShape> sceneMarkShapes = sceneMarkShapeService.findByNumAndType(param.getNum(),param.getType());
|
|
|
+ for (SceneMarkShape sceneMarkShape : sceneMarkShapes) {
|
|
|
+ if (ObjectUtil.isNotEmpty(sceneMarkShape.getShapes())){
|
|
|
+ for (JSONObject shape : sceneMarkShape.getShapes()) {
|
|
|
+ String category = shape.getString("category");
|
|
|
+ SceneShapeEnum sceneShapeEnum = sceneShapeEnumService.findByClassName(category);
|
|
|
+ if (ObjectUtil.isNotNull(sceneShapeEnum)){
|
|
|
+ shape.put("name",sceneShapeEnum.getName());
|
|
|
+ }
|
|
|
+ if (category.contains("Tag_")){
|
|
|
+ shape.put("category","Tag");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return ResultData.ok(sceneMarkShapes);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|