Add Tag creation usecase
This commit is contained in:
parent
1861bdfe74
commit
d6efbf757f
3 changed files with 13 additions and 2 deletions
|
@ -2,6 +2,7 @@ package link;
|
|||
|
||||
import category.CategoryName;
|
||||
import category.CategoryRepository;
|
||||
import exeptions.URLIsNotReachable;
|
||||
import tag.TaggingUseCase;
|
||||
import user.Username;
|
||||
|
||||
|
@ -27,7 +28,9 @@ public class LinkUseCase {
|
|||
|
||||
public void addLink(LinkUrl url, Set<CategoryName> categoryNames, Username creator) {
|
||||
|
||||
OnlineCheck.of(url);
|
||||
if (!OnlineCheck.isReachable(url)) {
|
||||
throw new URLIsNotReachable("The url " + url + " does not seem online. Check if it is correct and you have internet access.");
|
||||
}
|
||||
|
||||
var categoryIds = categoryNames.stream().map(categoryRepository::getIdByName).collect(Collectors.toSet());
|
||||
|
||||
|
|
Reference in a new issue