refactor-architecture #27
2
pom.xml
2
pom.xml
@ -162,7 +162,7 @@
|
||||
<plugin>
|
||||
<groupId>com.diffplug.spotless</groupId>
|
||||
<artifactId>spotless-maven-plugin</artifactId>
|
||||
<version>2.46.1</version>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<java>
|
||||
<googleJavaFormat/>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.magamochi.mangamochi.model.dto;
|
||||
package com.magamochi.mangamochi.common.dto;
|
||||
|
||||
import jakarta.annotation.Nullable;
|
||||
import java.time.Instant;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.magamochi.mangamochi.model.dto;
|
||||
package com.magamochi.mangamochi.common.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.magamochi.mangamochi.exception;
|
||||
package com.magamochi.mangamochi.common.exception;
|
||||
|
||||
public class ConflictException extends RuntimeException {
|
||||
public ConflictException(String message) {
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.mangamochi.exception;
|
||||
package com.magamochi.mangamochi.common.exception;
|
||||
|
||||
import com.magamochi.mangamochi.model.dto.ErrorResponseDTO;
|
||||
import com.magamochi.mangamochi.common.dto.ErrorResponseDTO;
|
||||
import java.time.Instant;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.magamochi.mangamochi.exception;
|
||||
package com.magamochi.mangamochi.common.exception;
|
||||
|
||||
public class NotFoundException extends RuntimeException {
|
||||
public NotFoundException(String message) {
|
||||
@ -1,4 +1,4 @@
|
||||
package com.magamochi.mangamochi.exception;
|
||||
package com.magamochi.mangamochi.common.exception;
|
||||
|
||||
public class UnprocessableException extends RuntimeException {
|
||||
public UnprocessableException(String message) {
|
||||
@ -1,5 +1,6 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.*;
|
||||
import com.magamochi.mangamochi.service.UserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.model.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.GenreDTO;
|
||||
import com.magamochi.mangamochi.service.GenreService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.client.NtfyClient;
|
||||
import com.magamochi.mangamochi.model.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.UpdateMangaDataCommand;
|
||||
import com.magamochi.mangamochi.model.repository.UserRepository;
|
||||
import com.magamochi.mangamochi.queue.UpdateMangaDataProducer;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.*;
|
||||
import com.magamochi.mangamochi.model.enumeration.ArchiveFileType;
|
||||
import com.magamochi.mangamochi.service.MangaChapterService;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.*;
|
||||
import com.magamochi.mangamochi.service.MangaService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.*;
|
||||
import com.magamochi.mangamochi.service.MangaImportService;
|
||||
import com.magamochi.mangamochi.service.ProviderManualMangaImportService;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.model.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.ImportReviewDTO;
|
||||
import com.magamochi.mangamochi.service.MangaImportReviewService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.*;
|
||||
import com.magamochi.mangamochi.service.ProviderService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.mangamochi.controller;
|
||||
|
||||
import com.magamochi.mangamochi.model.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.mangamochi.service.UserFavoriteMangaService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.mangamochi.service;
|
||||
|
||||
import com.magamochi.mangamochi.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.common.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.model.entity.Language;
|
||||
import com.magamochi.mangamochi.model.repository.LanguageRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.magamochi.mangamochi.service;
|
||||
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import com.magamochi.mangamochi.exception.UnprocessableException;
|
||||
import com.magamochi.mangamochi.common.exception.UnprocessableException;
|
||||
import com.magamochi.mangamochi.model.dto.MangaChapterArchiveDTO;
|
||||
import com.magamochi.mangamochi.model.dto.MangaChapterImagesDTO;
|
||||
import com.magamochi.mangamochi.model.entity.MangaChapter;
|
||||
|
||||
@ -4,7 +4,7 @@ import static java.util.Objects.isNull;
|
||||
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import com.magamochi.mangamochi.client.JikanClient;
|
||||
import com.magamochi.mangamochi.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.common.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.model.dto.ImportReviewDTO;
|
||||
import com.magamochi.mangamochi.model.dto.UpdateMangaDataCommand;
|
||||
import com.magamochi.mangamochi.model.entity.Manga;
|
||||
|
||||
@ -6,7 +6,7 @@ import static java.util.Objects.nonNull;
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import com.magamochi.mangamochi.client.AniListClient;
|
||||
import com.magamochi.mangamochi.client.JikanClient;
|
||||
import com.magamochi.mangamochi.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.common.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.model.dto.ContentProviderMangaChapterResponseDTO;
|
||||
import com.magamochi.mangamochi.model.entity.*;
|
||||
import com.magamochi.mangamochi.model.repository.*;
|
||||
|
||||
@ -3,7 +3,7 @@ package com.magamochi.mangamochi.service;
|
||||
import static java.util.Objects.nonNull;
|
||||
|
||||
import com.magamochi.mangamochi.client.NtfyClient;
|
||||
import com.magamochi.mangamochi.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.common.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.model.dto.*;
|
||||
import com.magamochi.mangamochi.model.entity.Manga;
|
||||
import com.magamochi.mangamochi.model.entity.MangaChapter;
|
||||
@ -13,7 +13,6 @@ import com.magamochi.mangamochi.model.repository.*;
|
||||
import com.magamochi.mangamochi.model.specification.MangaSpecification;
|
||||
import com.magamochi.mangamochi.queue.MangaChapterDownloadProducer;
|
||||
import com.magamochi.mangamochi.service.providers.ContentProviderFactory;
|
||||
import java.net.*;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -3,7 +3,7 @@ package com.magamochi.mangamochi.service;
|
||||
import static java.util.Objects.isNull;
|
||||
import static java.util.Objects.nonNull;
|
||||
|
||||
import com.magamochi.mangamochi.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.common.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.model.dto.ImportMangaResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.ImportRequestDTO;
|
||||
import com.magamochi.mangamochi.model.entity.*;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.mangamochi.service;
|
||||
|
||||
import com.magamochi.mangamochi.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.common.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.model.entity.Manga;
|
||||
import com.magamochi.mangamochi.model.entity.UserFavoriteManga;
|
||||
import com.magamochi.mangamochi.model.repository.MangaRepository;
|
||||
|
||||
@ -2,8 +2,8 @@ package com.magamochi.mangamochi.service;
|
||||
|
||||
import static java.util.Objects.isNull;
|
||||
|
||||
import com.magamochi.mangamochi.exception.ConflictException;
|
||||
import com.magamochi.mangamochi.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.common.exception.ConflictException;
|
||||
import com.magamochi.mangamochi.common.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.model.dto.AuthenticationRequestDTO;
|
||||
import com.magamochi.mangamochi.model.dto.AuthenticationResponseDTO;
|
||||
import com.magamochi.mangamochi.model.dto.RefreshTokenRequestDTO;
|
||||
|
||||
@ -2,7 +2,7 @@ package com.magamochi.mangamochi.service.providers.impl;
|
||||
|
||||
import static java.util.Objects.isNull;
|
||||
|
||||
import com.magamochi.mangamochi.exception.UnprocessableException;
|
||||
import com.magamochi.mangamochi.common.exception.UnprocessableException;
|
||||
import com.magamochi.mangamochi.model.dto.ContentProviderMangaChapterResponseDTO;
|
||||
import com.magamochi.mangamochi.model.entity.MangaProvider;
|
||||
import com.magamochi.mangamochi.service.FlareService;
|
||||
|
||||
@ -4,7 +4,7 @@ import static java.util.Objects.isNull;
|
||||
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import com.magamochi.mangamochi.client.MangaDexClient;
|
||||
import com.magamochi.mangamochi.exception.UnprocessableException;
|
||||
import com.magamochi.mangamochi.common.exception.UnprocessableException;
|
||||
import com.magamochi.mangamochi.model.dto.ContentProviderMangaChapterResponseDTO;
|
||||
import com.magamochi.mangamochi.model.entity.MangaProvider;
|
||||
import com.magamochi.mangamochi.service.providers.ContentProvider;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.mangamochi.task;
|
||||
|
||||
import com.magamochi.mangamochi.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.common.exception.NotFoundException;
|
||||
import com.magamochi.mangamochi.model.dto.MangaListUpdateCommand;
|
||||
import com.magamochi.mangamochi.model.repository.ProviderRepository;
|
||||
import com.magamochi.mangamochi.queue.UpdateMangaListProducer;
|
||||
|
||||
@ -13,7 +13,8 @@ $$
|
||||
WHERE name = _target_provider_name;
|
||||
|
||||
IF _target_provider_id IS NULL THEN
|
||||
RAISE EXCEPTION 'Provider with name "%" not found.', _target_provider_name;
|
||||
RAISE NOTICE 'Provider with name "%" not found.', _target_provider_name;
|
||||
RETURN;
|
||||
END IF;
|
||||
|
||||
UPDATE providers SET status = 'INACTIVE' WHERE id = _target_provider_id;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user