package es.uv.dagarcos.master.controller;

import es.uv.dagarcos.master.dto.PlayerOverviewDto;
import es.uv.dagarcos.master.service.PlayerDashboardService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/master/players")
@CrossOrigin
public class DashboardPlayerController {

    @Autowired
    private PlayerDashboardService service;

    @GetMapping
    public List<PlayerOverviewDto> getPlayers() {
        return service.getGlobalPlayers();
    }

}