Update TagService.java

This commit is contained in:
anastasia shulga 2019-04-16 07:55:37 +00:00
parent 1f36e04cd3
commit dbd61ce80c

View File

@ -23,8 +23,16 @@ public class TagService {
return tags return tags
.stream() .stream()
.map(tag -> { .map(tag -> {
return tag.getId() != null ? getExistById(tag) : if(tag.getId() != null){
isExistByName(tag.getTagName()) != null ? isExistByName(tag.getTagName()) : create(tag); return getExistById(tag);
}else {
Tag existTag = isExistByName(tag.getTagName());
if(existTag != null){
return existTag;
}else{
return create(tag);
}
}
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }