Commit 03999886 by zhangkb

修改标签删除接口,联动删除该标签打在所有元数据中

parent 5efbf800
...@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.keymobile.tagmanager.exception.TagException;
@FeignClient(name = "MetadataRepo") @FeignClient(name = "MetadataRepo")
public interface RepoServiceClient { public interface RepoServiceClient {
@PostMapping(value = "/rest/tag/getByTag") @PostMapping(value = "/rest/tag/getByTag")
...@@ -56,4 +58,8 @@ public interface RepoServiceClient { ...@@ -56,4 +58,8 @@ public interface RepoServiceClient {
@GetMapping(value = "/rest/tag/aggregate") @GetMapping(value = "/rest/tag/aggregate")
public List<Map<String,Object>> aggregate(@RequestParam(required = false) String modelPath, public List<Map<String,Object>> aggregate(@RequestParam(required = false) String modelPath,
@RequestParam String attributeName); @RequestParam String attributeName);
@PostMapping(value = "rest/tag/deleteTag")
public int deleteTag(@RequestParam String idPath, @RequestParam String tagType,
@RequestParam String dimensionType) throws TagException;
} }
...@@ -103,9 +103,15 @@ public class TagService { ...@@ -103,9 +103,15 @@ public class TagService {
if (!childs.isEmpty()) { if (!childs.isEmpty()) {
throw new TagException("存在子节点,不允许删除!"); throw new TagException("存在子节点,不允许删除!");
} }
//删除元数据中打了这个标签的
int result = repoService.deleteTag(parentTag.getIdPath(),
parentTag.getTagType(), parentTag.getDimensionType());
//如果删除成功
if(result>=0) {
tagRepository.deleteById(tagId); tagRepository.deleteById(tagId);
} }
} }
}
//判断标签是否有子节点 //判断标签是否有子节点
public boolean hasChild(String tagId, String userName) throws TagException { public boolean hasChild(String tagId, String userName) throws TagException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment