from pot_libs.sanic_api import summary
from unify_api.modules.load_analysis.components.load_forecast_cps import (
    ForecastReq,
    ForecastResp,
)
from unify_api.modules.load_analysis.service.load_forecast_service import \
    load_forecast_service, load_forecast_service_new15


@summary("负荷预测")
async def post_load_forecast(req, body: ForecastReq) -> ForecastResp:
    """负荷预测"""
    # 1.获取参数
    cid = body.cid
    start = body.start
    end = body.end
    # 管理版本多个工厂的情况, 兼容能力最强的参数cids， 保留旧有的cid:
    cids = body.cids
    # return await load_forecast_service(cid, cids, start, end)
    return await load_forecast_service_new15(cid, cids, start, end)
