Commit 03999886 by zhangkb

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

parent 5efbf800
......@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import com.keymobile.tagmanager.exception.TagException;
@FeignClient(name = "MetadataRepo")
public interface RepoServiceClient {
@PostMapping(value = "/rest/tag/getByTag")
......@@ -56,4 +58,8 @@ public interface RepoServiceClient {
@GetMapping(value = "/rest/tag/aggregate")
public List<Map<String,Object>> aggregate(@RequestParam(required = false) String modelPath,
@RequestParam String attributeName);
@PostMapping(value = "rest/tag/deleteTag")
public int deleteTag(@RequestParam String idPath, @RequestParam String tagType,
@RequestParam String dimensionType) throws TagException;
}
......@@ -103,7 +103,13 @@ public class TagService {
if (!childs.isEmpty()) {
throw new TagException("存在子节点,不允许删除!");
}
tagRepository.deleteById(tagId);
//删除元数据中打了这个标签的
int result = repoService.deleteTag(parentTag.getIdPath(),
parentTag.getTagType(), parentTag.getDimensionType());
//如果删除成功
if(result>=0) {
tagRepository.deleteById(tagId);
}
}
}
......
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