package com.sky.ioc.controller.life;

import com.sky.ioc.entity.params.IocParam;
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.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO 智能生活 ---- 智慧停车
 * @Description
 * @Author LunCe
 * @Date 2023/2/10 13:27
 **/


@Api(tags ="智享生活----智慧停车")
@Slf4j
@RestController
@RequestMapping("parking")
public class ParkingController {




    @Autowired
    private ParkingService parkingService;

    @Autowired
    ParkService parkService;

    @Autowired
    IllegalParkingService illegalParkingService;


    @ApiOperation("查询智慧生活中智慧停车的核心指标")
    @PostMapping("getCoreIndicators")
    public ReturnMsg getCoreIndicators(@RequestBody IocParam iocParam){
//        dateType   1.周，2.月，3.年
        return parkingService.getCoreIndicators(iocParam);
    }


    @ApiOperation("查询智慧生活中智慧停车的车流态势")
    @PostMapping("getTrafficflowSituation")
    public ReturnMsg  getTrafficflowSituation(@RequestBody IocParam iocParam){
//        dateType   1.周，2.月，3.年
        return parkingService.getTrafficflowSituation(iocParam);
    }


    @ApiOperation("查询智慧生活中智慧停车的空置车位")
    @PostMapping("getVacantParkingSpace")
    public ReturnMsg  getVacantParkingSpace(@RequestBody IocParam iocParam){
//        dateType   1.周，2.月，3.年
        return parkingService.getVacantParkingSpace(iocParam);
    }



    @ApiOperation("查询智慧生活中智慧停车的车位详情")
    @PostMapping("getParkingSpaceDetails")
    public ReturnMsg  getParkingSpaceDetails(@RequestBody IocParam iocParam){
//        dateType   1.周，2.月，3.年
        return parkingService.getParkingSpaceDetails(iocParam);
    }


    @ApiOperation("查询智慧生活中智慧停车的违停情况")
    @PostMapping("getStopViolation")
    public ReturnMsg  getStopViolation(@RequestBody IocParam iocParam){
//        dateType   1.周，2.月，3.年
        return parkingService.getStopViolation(iocParam);
    }



    @ApiOperation("查询智慧生活中智慧停车的占用车位数量")
    @PostMapping("getOccupationOfParkingSpace")
    public ReturnMsg  getOccupationOfParkingSpace(@RequestBody IocParam iocParam){
//        dateType   1.周，2.月，3.年
        return parkingService.getOccupationOfParkingSpace(iocParam);
    }

    @ApiOperation("车位信息")
    @PostMapping("getParkingData")
    public ReturnMsg  getParkingData(){
//        dateType   1.周，2.月，3.年
        return illegalParkingService.getIllegalParkingData();
    }




}
