package com.sky.ioc.controller.dashboard;

import com.sky.ioc.entity.params.IocParam;
import com.sky.ioc.service.carbon.CarbonService;
import com.sky.ioc.service.space.SpaceService;
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;

/** 智能看板
 * @author LunCe*/
@Api(tags ="智能看板")
@Slf4j
@RestController
@RequestMapping("/dashboard")
public class DashboardController {


    @Autowired
    private SpaceService spaceService;


    @Autowired
    private CarbonService carbonService;


    /**
     *
     * 楼宇模块
     * */

    @ApiOperation("智能看板-楼宇态势")
    @PostMapping("getBuildingSituation")
    public ReturnMsg getBuildingSituation(){
        return spaceService.getBuildingSituation();
    }
    /**
     *
     * 空间概览
     * */
    @ApiOperation("智能看板-空间概览")
    @PostMapping("getSpaceOverview")
    public ReturnMsg getSpaceOverview(){
        return spaceService.getSpaceOverview();
    }

    /**
     *
     * 光伏发电量
     * */
    @ApiOperation("智能看板-光伏发电量")
    @PostMapping("getPhotovoltaicPower")
    public ReturnMsg getPhotovoltaicPower(@RequestBody IocParam iocParam){
        return carbonService.getPhotovoltaicPower(iocParam);
    }


    /**
     *
     * 碳配额
     * */
    @ApiOperation("智能看板-碳配额")
    @PostMapping("getCarbonQuota")
    public ReturnMsg getCarbonQuota(){
        return carbonService.getCarbonQuota();
    }



    @ApiOperation("智能看板-光伏盈利")
    @PostMapping("getPhotovoltaicProfit")
    public ReturnMsg getPhotovoltaicProfit(){
        return carbonService.getPhotovoltaicProfit();
    }

}
