package com.kym.service.admin;

import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.github.yulichang.base.MPJBaseService;
import com.kym.common.annotation.DynamicCache;
import com.kym.entity.admin.ConnectorInfo;
import com.kym.entity.admin.EquipmentInfo;
import com.kym.entity.admin.Station;
import com.kym.entity.admin.queryParams.StationQueryParam;
import com.kym.entity.admin.vo.DetailStationVo;
import com.kym.entity.admin.vo.SimpleStationVo;
import com.kym.entity.admin.vo.StationVo;
import com.kym.entity.common.PageBean;
import com.kym.entity.platform.PlatformStationStatsInfo;
import com.kym.entity.platform.PlatformStationStatusInfo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 充电站信息 服务类
 * </p>
 *
 * @author skyline
 * @since 2023-08-12
 */
public interface StationService extends MPJBaseService<Station> {

    List<Station> listStation(StationQueryParam params);

    List<StationVo> queryPlatformStationInfo(String platformName, int pageNum, int pageSize, String... stationIds) throws JsonProcessingException;

    Map<String, List<EquipmentInfo>> getCachedEquipmentMap(String... stationId);

    @DynamicCache(timeout = 15 * 60 * 1000L)
    Map<String, List<ConnectorInfo>> getCachedEquipmentConnectorMap(String... stationId);

    Map<String, List<ConnectorInfo>> getCachedEquipmentConnectorMap();

    DetailStationVo stationInfo(String stationId);

    List<PlatformStationStatusInfo> stationStatus(String[] ids);

    PlatformStationStatsInfo stationStats(String stationId, String startTime, String endTime);

    void pullEnStationInfos(String stationId);

    void modifyStation(Station station);

    void importStation(JSONObject data);

    PageBean<SimpleStationVo> listStationForApp(StationQueryParam params);

    DetailStationVo stationInfoByShortId(String shortId);

    DetailStationVo stationInfoByConnectorId(String connectorId);

    DetailStationVo stationInfoByEquipmentId(String equipmentId);
}
