package cc.mrbird.febs.dapp.soccer.controller; import cc.mrbird.febs.common.entity.FebsResponse; import cc.mrbird.febs.dapp.soccer.dto.LeaguesApiDto; import cc.mrbird.febs.dapp.soccer.dto.TeamsApiDto; import cc.mrbird.febs.dapp.soccer.service.CountryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @Slf4j @RequiredArgsConstructor @CrossOrigin("*") @RestController @Api(value = "FOOTBALL", tags = "FOOTBALL") @RequestMapping(value = "/dapi/footBall") public class SoccerController { private final CountryService countryService; @ApiOperation(value = "获取时区", notes = "获取时区") @PostMapping(value = "/timezone") public FebsResponse timezone() { return countryService.timezone(); } @ApiOperation(value = "获取国家", notes = "获取国家") @PostMapping(value = "/countries") public FebsResponse countriesApi() { return countryService.countries(); } @ApiOperation(value = "获取联赛", notes = "获取联赛") @PostMapping(value = "/leagues") public FebsResponse leagues(LeaguesApiDto leaguesApiDto) { return countryService.leagues(leaguesApiDto); } @ApiOperation(value = "获取联赛赛季", notes = "获取联赛赛季") @PostMapping(value = "/leagues/seasons") public FebsResponse seasons() { return countryService.seasons(); } @ApiOperation(value = "获取球队", notes = "获取球队") @PostMapping(value = "/teams") public FebsResponse teams(TeamsApiDto teamsApiDto) { return countryService.teams(teamsApiDto); } }