package com.usky.fire.service.api;

import com.usky.common.core.util.HttpUtils;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author yq
 * @date 2021/8/13 9:17
 */
@Slf4j
public class KafkaTableApi {

    private final static String URL = "http://IP：端口/kafka/property";

    public static String uploadTable(String tbName, String dbId, Integer total, List<Object> list) {
        Map<String, Object> params = new HashMap<>();
        params.put("tbName", tbName);
        params.put("dbId", dbId);
        params.put("total", total);
        params.put("data", list);
        String result = "";
        try {
            result = HttpUtils.postJson(URL, params, null);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }
}
