package com.zcxk.controller;

import com.zcxk.dto.ranking.RankingDto;
import com.zcxk.model.AjaxMessage;
import com.zcxk.model.ResultStatus;
import com.zcxk.service.RankingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description
 * @auto lihui
 * @data 2021-04-01
 */
@RestController
@RequestMapping("/ranking")
@Api(tags = "排名")
@Slf4j
public class RankingController {

    @Autowired
    private RankingService rankingService;

    @RequestMapping(value="getPipePressure" , method = RequestMethod.GET)
    @ApiOperation(value = "管网压力排名")
    public AjaxMessage<List<RankingDto>> getPipePressure(){
        return new AjaxMessage<List<RankingDto>>(ResultStatus.OK, rankingService.findPipeRanking("压力", 13));
    }

}
