package com.micer.easyball.controller;

import com.micer.easyball.ApiVersion;

import com.micer.easyball.pojo.ResponseResult;
import com.micer.easyball.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(ApiVersion.V1)
public class EventController {

    @Autowired
    EventService eventService;
    /**
     * 获取所有赛事
     */
    @PreAuthorize("@ex.hasRole('ROLE_CLUB_PLAYER')")
    @GetMapping("/event/getEvents")
    public ResponseResult getEvents()
    {
        return eventService.getEvents();
    }
}
