Commit 9cbfe82a by zhangkb

根据标签id列表获取标签list接口

parent b886ee19
......@@ -84,10 +84,10 @@ public class TagCtrl {
return tagService.hasChild(tagId, userName);
}
@ApiOperation(value = "根据标签id获取标签信息", notes = "根据标签id获取标签信息")
@PostMapping(value = "/getTagById")
public Tag getTagById(@RequestParam(value = "tagId") String tagId) throws Exception{
return tagService.getTagById(tagId);
@ApiOperation(value = "根据多个标签id获取标签信息列表", notes = "根据标签id获取标签信息列表")
@PostMapping(value = "/getTagListByIds")
public List<Tag> getTagListByIds(@RequestBody List<String> tagIds) throws Exception{
return tagService.getTagListByIds(tagIds);
}
@ApiOperation(value = "获取维度标签树", notes = "获取维度标签树")
......
......@@ -12,4 +12,6 @@ public interface TagRepository extends MongoRepository<Tag, String> {
public Optional<Tag> findByIdPath(String idPath);
public List<Tag> findByIdPathLikeAndNameLike(String idPath,String tagName);
public List<Tag> findByIdIn(List<String> ids);
}
......@@ -124,6 +124,10 @@ public class TagService {
return false;
}
public List<Tag> getTagListByIds(List<String> ids)throws TagNotExistException {
return tagRepository.findByIdIn(ids);
}
//根据标签id获取标签
public Tag getTagById(String tagId) throws TagNotExistException {
Tag t = mongoOperations.findOne(Query.query(Criteria.where("_id").is(tagId)), Tag.class);
......
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