27 lines
774 B
Java
27 lines
774 B
Java
package com.magamochi.controller;
|
|
|
|
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")
|
|
@RequiredArgsConstructor
|
|
public class GenreController {
|
|
private final GenreService genreService;
|
|
|
|
@Operation(
|
|
summary = "Get a list of genres",
|
|
description = "Retrieve a list of genres.",
|
|
tags = {"Genre"},
|
|
operationId = "getGenres")
|
|
@GetMapping
|
|
public DefaultResponseDTO<List<GenreDTO>> getGenres() {
|
|
return DefaultResponseDTO.ok(genreService.getGenres());
|
|
}
|
|
}
|