package com.sundot.airport.web.controller.home;

import com.sundot.airport.common.core.controller.BaseController;
import com.sundot.airport.common.core.domain.AjaxResult;
import com.sundot.airport.item.domain.dto.RankingQueryParamDto;
import com.sundot.airport.item.domain.dto.SeizureRankingDto;
import com.sundot.airport.item.service.SeizureRankingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 查获排名控制器
 */
@Api(tags = "查获排名")
@Controller
@RequestMapping("/item/seizure/ranking")
public class SeizureRankingController extends BaseController {

    @Autowired
    private SeizureRankingService seizureRankingService;

    /**
     * 根据角色获取查获排名
     */
    @ApiOperation("根据角色获取查获排名")
    @PostMapping("/getRankingByRole")
    @ResponseBody
    public AjaxResult getRankingByRole(@RequestBody RankingQueryParamDto param) {
        List<SeizureRankingDto> result = seizureRankingService.getRankingByRole(param);
        return AjaxResult.success(result);
    }

}