package cn.sh.stc.sict.cloud.common.data.util;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import cn.sh.stc.sict.cloud.common.data.dto.EventInfo;
import lombok.experimental.UtilityClass;

/**
 * 联盟链工具类
 * @author admin
 */
@UtilityClass
public class UnionChainUtil {

    /**
     * 存储一般事件
     *
     * @param event
     */
    public String saveEvent(String url, EventInfo event) {
        String body = HttpRequest.post(url)
                .body(JSONUtil.toJsonStr(event))
                .execute()
                .body();
        System.out.println(body);
        return body;
    }
}
