refactor: rename GenreController to CatalogController and update package structure
This commit is contained in:
parent
d845dc4d12
commit
a6f01bba30
@ -1,25 +1,25 @@
|
||||
package com.magamochi.controller;
|
||||
package com.magamochi.catalog.controller;
|
||||
|
||||
import com.magamochi.catalog.model.dto.GenreDTO;
|
||||
import com.magamochi.catalog.service.GenreService;
|
||||
import com.magamochi.common.dto.DefaultResponseDTO;
|
||||
import com.magamochi.model.dto.GenreDTO;
|
||||
import com.magamochi.service.GenreService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/genres")
|
||||
@RequestMapping("/catalog")
|
||||
@RequiredArgsConstructor
|
||||
public class GenreController {
|
||||
public class CatalogController {
|
||||
private final GenreService genreService;
|
||||
|
||||
@Operation(
|
||||
summary = "Get a list of genres",
|
||||
description = "Retrieve a list of genres.",
|
||||
tags = {"Genre"},
|
||||
summary = "Get a list of manga genres",
|
||||
description = "Retrieve a list of manga genres.",
|
||||
tags = {"Catalog"},
|
||||
operationId = "getGenres")
|
||||
@GetMapping
|
||||
@GetMapping("/genres")
|
||||
public DefaultResponseDTO<List<GenreDTO>> getGenres() {
|
||||
return DefaultResponseDTO.ok(genreService.getGenres());
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.model.dto;
|
||||
package com.magamochi.catalog.model.dto;
|
||||
|
||||
import com.magamochi.model.entity.Genre;
|
||||
import com.magamochi.catalog.model.entity.Genre;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.magamochi.model.entity;
|
||||
package com.magamochi.catalog.model.entity;
|
||||
|
||||
import com.magamochi.model.entity.MangaGenre;
|
||||
import jakarta.persistence.*;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.model.repository;
|
||||
package com.magamochi.catalog.model.repository;
|
||||
|
||||
import com.magamochi.model.entity.Genre;
|
||||
import com.magamochi.catalog.model.entity.Genre;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.magamochi.service;
|
||||
package com.magamochi.catalog.service;
|
||||
|
||||
import com.magamochi.model.dto.GenreDTO;
|
||||
import com.magamochi.model.repository.GenreRepository;
|
||||
import com.magamochi.catalog.model.dto.GenreDTO;
|
||||
import com.magamochi.catalog.model.repository.GenreRepository;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -1,5 +1,6 @@
|
||||
package com.magamochi.model.entity;
|
||||
|
||||
import com.magamochi.catalog.model.entity.Genre;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.magamochi.model.repository;
|
||||
|
||||
import com.magamochi.model.entity.Genre;
|
||||
import com.magamochi.catalog.model.entity.Genre;
|
||||
import com.magamochi.model.entity.Manga;
|
||||
import com.magamochi.model.entity.MangaGenre;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -4,6 +4,8 @@ import static java.util.Objects.isNull;
|
||||
import static java.util.Objects.nonNull;
|
||||
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import com.magamochi.catalog.model.entity.Genre;
|
||||
import com.magamochi.catalog.model.repository.GenreRepository;
|
||||
import com.magamochi.client.AniListClient;
|
||||
import com.magamochi.client.JikanClient;
|
||||
import com.magamochi.common.exception.NotFoundException;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user