package com.ho.business.controller;


import com.ho.business.service.ZhouZiHuanBaoService;
import com.ho.business.vo.req.StationReq;
import com.ho.business.vo.resp.zhongzi.ZhouZiHuanBaoPV;
import com.ho.business.vo.resp.zhongzi.ZhouZiHuanBaoStatus;
import com.ho.common.tools.constant.ContextConstant;
import com.ho.common.tools.exception.DataResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
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 xwz
 * @desc: 中自环保定制化首页
 * @date 2023/12/13
 */
@RestController
@RequestMapping(ContextConstant.BUSINESS + "zhongZiHuanBao")
@Api(tags = "中自环保定制化首页")
@Slf4j
@Data
public class ZhongZiHuanBaoController {

    @Autowired
    ZhouZiHuanBaoService zhouZiHuanBaoService;
    
    @PostMapping("/status")
    @ApiOperation(value = "站首页的中间部分")
    public DataResult<ZhouZiHuanBaoStatus> getStatus(@RequestBody StationReq req) {
        ZhouZiHuanBaoStatus middlePart = zhouZiHuanBaoService.getMiddlePart(req);
        return DataResult.success(middlePart);
    }

    @PostMapping("/getStationData")
    @ApiOperation(value = "站首页的电站数据")
    public DataResult<ZhouZiHuanBaoPV> getStationData(@RequestBody StationReq req) {
        ZhouZiHuanBaoPV stationData = zhouZiHuanBaoService.getStationData(req);
        return DataResult.success(stationData);
    }
}
