package com.kym.common.enums;

import cn.hutool.extra.spring.SpringUtil;
import com.kym.common.config.EnPlusConfig;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.web.bind.annotation.RequestMethod;


/**
 * @author skyline
 * @description EN+接口
 * @date 2023-07-29 12:33
 */
@AllArgsConstructor
@Getter
public enum EnPlusApi implements Api {

    // 认证-获取token
    EN_PLUS_QUERY_TOKEN(Constants.DOMAIN + "query_token", RequestMethod.POST), //获取AccessToken

    // 站点
    EN_PLUS_QUERY_STATION_INFO(Constants.DOMAIN + "query_stations_info", RequestMethod.POST), // 站点信息
    EN_PLUS_QUERY_STATION_STATUS(Constants.DOMAIN + "query_station_status", RequestMethod.POST), // 站点状态
    EN_PLUS_QUERY_STATION_STATS(Constants.DOMAIN + "query_station_stats", RequestMethod.POST), // 站点统计
    //充电
    EN_PLUS_QUERY_EQUIP_AUTH(Constants.DOMAIN + "query_equip_auth", RequestMethod.POST), // 请求设备认证
    EN_PLUS_QUERY_EQUIP_BUSINESS_POLICY(Constants.DOMAIN + "query_equip_business_policy", RequestMethod.POST), // 查询业务策略信息
    EN_PLUS_QUERY_START_CHARGE(Constants.DOMAIN + "query_start_charge", RequestMethod.POST), // 查询启动充电
    EN_PLUS_QUERY_STOP_CHARGE(Constants.DOMAIN + "query_stop_charge", RequestMethod.POST), // 请求停止充电
    EN_PLUS_QUERY_EQUIP_CHARGE_STATUS(Constants.DOMAIN + "query_equip_charge_status", RequestMethod.POST), // 查询设备充电状态

    //微信
    WX_MP_GET_PHONE("", RequestMethod.POST), // 获取手机号
    WX_GET_ACCESS_TOKEN("", RequestMethod.POST); // 获取AccessToken

    private final String api;
    private final RequestMethod requestMethod;


    private static class Constants {
        static EnPlusConfig config = SpringUtil.getBean("EnPlusConfig");
        private static final String DOMAIN = config.getApiDomain();
    }
}