package com.zhongshu.card.server.core.httpRequest.conf;

import com.github.microservice.core.util.net.apache.MethodType;
import com.github.microservice.http.ApiConfParam;

import java.util.HashMap;

/**
 * 物联网平台的 APIP
 *
 * @author TRX
 * @date 2024/6/25
 */
public class IotCenterAPIConfig {

    // 测试发送消息
    public static final String sendMessage = "/test/free/sendMessage";

    public static final String ping = "/test/free/ping";

    // 项目同步
    public static final String syncFromFullCardProjects = "/projectSync/free/syncFromFullCardProjects";

    public static final String openAPISendMessage = "/iotOpenAPI/manager/v1/sendIotMessage";

    public static final String sendIotGateWayMessage = "/iotOpenAPI/manager/v1/sendIotGateWayMessage";

    public static final HashMap<String, ApiConfParam> map = new HashMap<>();

    static {
        map.put(sendMessage, ApiConfParam.builder().apiName(sendMessage).methodType(MethodType.Json.name()).build());
        map.put(ping, ApiConfParam.builder().apiName(ping).methodType(MethodType.Get.name()).build());

        map.put(syncFromFullCardProjects, ApiConfParam.builder().apiName(syncFromFullCardProjects).methodType(MethodType.Json.name()).build());

        map.put(openAPISendMessage, ApiConfParam.builder().apiName(openAPISendMessage)
                .methodType(MethodType.Json.name()).build());
    }

    public static ApiConfParam getApiConfParam(String apiName) {
        return map.get(apiName);
    }

}
