1

remove simple to fix warnings

Co-authored-by: Christoph <tobi@urpost.de>
This commit is contained in:
Christoph
2020-03-29 00:15:22 +01:00
parent eb11751663
commit 98607dcf49
33 changed files with 672 additions and 545 deletions

View File

@ -4,6 +4,8 @@ import mops.gruppen2.domain.dto.InviteLinkDTO;
import mops.gruppen2.domain.exception.InvalidInviteException;
import mops.gruppen2.domain.exception.NoInviteExistException;
import mops.gruppen2.repository.InviteRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.UUID;
@ -11,17 +13,18 @@ import java.util.UUID;
@Service
public class InviteService {
private static final Logger LOG = LoggerFactory.getLogger(InviteService.class);
private final InviteRepository inviteRepository;
public InviteService(InviteRepository inviteRepository) {
this.inviteRepository = inviteRepository;
}
public void createLink(UUID groupId) {
void createLink(UUID groupId) {
inviteRepository.save(new InviteLinkDTO(null, groupId.toString(), UUID.randomUUID().toString()));
}
public void destroyLink(UUID groupId) {
void destroyLink(UUID groupId) {
inviteRepository.deleteLinkOfGroup(groupId.toString());
}
@ -29,7 +32,7 @@ public class InviteService {
try {
return UUID.fromString(inviteRepository.findGroupIdByLink(link));
} catch (Exception e) {
e.printStackTrace();
LOG.error("Gruppe zu Link ({}) konnte nicht gefunden werden!", link);
}
throw new InvalidInviteException(link);
@ -39,7 +42,7 @@ public class InviteService {
try {
return inviteRepository.findLinkByGroupId(groupId.toString());
} catch (Exception e) {
e.printStackTrace();
LOG.error("Link zu Gruppe ({}) konnte nicht gefunden werden!", groupId);
}
throw new NoInviteExistException(groupId.toString());