package com.hdkj.lt.si.service.algorithm.impl;

import com.hdkj.lt.si.modle.algorithm.IndicatorStatusResponse;
import com.hdkj.lt.si.service.algorithm.AlgorithmService;
import com.hdkj.lt.si.service.remote.impl.AlgorithmRemoteCallServiceImpl;
import com.hdkj.lt.si.service.staticgrid.StaticIndicatorResultService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 算法服务业务实现
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class AlgorithmServiceImpl implements AlgorithmService {

    @Resource(type = AlgorithmRemoteCallServiceImpl.class)
    private AlgorithmRemoteCallServiceImpl algorithmRemoteCallService;

    private final StaticIndicatorResultService staticIndicatorResultService;

    @Override
    public IndicatorStatusResponse queryIndicators() {
        return algorithmRemoteCallService.queryIndicators();
    }

    @Override
    public Long queryStaticGridIndicators(String batchId, String countyId, String countySid, String countyName, String topologyVersion) {
        return staticIndicatorResultService.saveStaticGridResult(batchId, countyId, countySid, countyName, topologyVersion);
    }

    @Override
    public Long triggerManualStaticGrid(String countyId, String countySid, String countyName, String topologyVersion) {
        return staticIndicatorResultService.triggerManualStaticGrid(countyId, countySid, countyName, topologyVersion);
    }
}
