package com.kym.service.platform;

import com.kym.common.cache.PlatformCache;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMethod;


/**
 * @author skyline
 * 公共接口
 */
@AllArgsConstructor
public enum PlatformApi implements Api {

    // 认证-获取token
    PLATFORM_QUERY_TOKEN("query_token", RequestMethod.POST), //获取AccessToken

    // 站点
    PLATFORM_QUERY_STATION_INFO("query_stations_info", RequestMethod.POST), // 站点信息
    PLATFORM_QUERY_STATION_STATUS("query_station_status", RequestMethod.POST), // 站点状态
    PLATFORM_QUERY_STATION_STATS("query_station_stats", RequestMethod.POST), // 站点统计
    //充电
    PLATFORM_QUERY_EQUIP_AUTH("query_equip_auth", RequestMethod.POST), // 请求设备认证
    PLATFORM_QUERY_EQUIP_BUSINESS_POLICY("query_equip_business_policy", RequestMethod.POST), // 查询业务策略信息
    PLATFORM_QUERY_START_CHARGE("query_start_charge", RequestMethod.POST), // 查询启动充电
    PLATFORM_QUERY_STOP_CHARGE("query_stop_charge", RequestMethod.POST), // 请求停止充电
    PLATFORM_QUERY_EQUIP_CHARGE_STATUS("query_equip_charge_status", RequestMethod.POST); // 查询设备充电状态


    private final String api;
    private final RequestMethod requestMethod;

    public String getApi(String platformName) {
        var config = PlatformCache.INSTANCE.getPlatformByName(platformName);
        return config.getApiDomain() + api;
    }

}
