refactored channel exception to have a unified interface to form the exception message

replaced getOne with findById in order to get optionals and handle those
some places still have the general abstracto run time exception
This commit is contained in:
Sheldan
2020-05-13 12:49:08 +02:00
parent 5755d033eb
commit c429aa882b
52 changed files with 501 additions and 344 deletions

View File

@@ -7,10 +7,11 @@ import dev.sheldan.abstracto.modmail.models.database.ModMailThread;
import dev.sheldan.abstracto.modmail.models.database.ModMailThreadState;
import java.util.List;
import java.util.Optional;
public interface ModMailThreadManagementService {
ModMailThread getByChannelId(Long channelId);
ModMailThread getById(Long modMailThreadId);
Optional<ModMailThread> getById(Long modMailThreadId);
ModMailThread getByChannel(AChannel channel);
List<ModMailThread> getThreadByUserAndState(AUserInAServer userInAServer, ModMailThreadState state);
ModMailThread getOpenModmailThreadForUser(AUserInAServer userInAServer);