package com.sc.sicanet.migracion_sicanet.controller.catalogos;

import com.sc.sicanet.migracion_sicanet.DTO.catalogos.CatDestinosDTO;
import com.sc.sicanet.migracion_sicanet.entity.CatDestinos;
import com.sc.sicanet.migracion_sicanet.service.catalogos.CatDestinosService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/catalogo")
public class CatDestinosController {
    @Autowired
    private CatDestinosService catDestinosService;

    @GetMapping("/destino-recurso")
    public ResponseEntity<List<CatDestinosDTO>> findAllDestinos() {
        List<CatDestinosDTO> destinos = catDestinosService.findDestino();
        return new ResponseEntity<>(destinos, HttpStatus.OK);
    }
}