package com.sky.ioc.controller.carbon;

import com.sky.ioc.entity.params.IocParam;
import com.sky.ioc.service.carbon.CarCarbonService;
import com.sky.ioc.service.carbon.CarbonService;
import com.sky.ioc.service.parking.IllegalParkingService;
import com.sky.ioc.service.parking.ParkService;
import com.sky.ioc.service.parking.ParkingService;
import com.sky.ioc.tool.ReturnMsg;
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.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @Description
 * @Author LunCe
 * @Date 2023/3/1 13:24
 **/


@Api(tags ="数智双碳----车辆排放")
@Slf4j
@RestController
@RequestMapping("/vehicle")
public class VehicleController {



    @Value("${spring.profiles.active}")
    private String active;

    @Autowired
    CarCarbonService carCarbonService;

    @ApiOperation("核心指标")
    @PostMapping("/getVehicleCoreIndicators")
    public ReturnMsg getVehicleCoreIndicators(@RequestBody IocParam iocParam){
        return carCarbonService.getVehicleCoreIndicators(iocParam);
    }

    @ApiOperation("车辆排放情况")
    @PostMapping("/getVehicleInfo")
    public ReturnMsg getVehicleInfo(@RequestBody IocParam iocParam){
        if(active.equals("publish")){
            return carCarbonService.getVehicleInfoData(iocParam);
        }else{
            return carCarbonService.getVehicleInfo(iocParam);
        }
    }

    @ApiOperation("车辆排放排名")
    @PostMapping("/getVehicleInfoOrder")
    public ReturnMsg getVehicleInfoOrder(@RequestBody IocParam iocParam){
        return carCarbonService.getVehicleInfoOrder(iocParam);
    }

}
