java程序动态生成二维码

java程序动态生成二维码

1、帮助类

package ydj.plugins.pojo.erweima;
import com.google.gson.Gson;
import java.lang.reflect.Type;
import java.util.Map;

public class JsonUtil {
   
    private static Gson gson = new Gson();
    public static Map<?, ?> jsonToMap(String jsonStr) {
   
        Map<?, ?> objMap = null;
        if (gson != null) {
   
            Type type = new com.google.gson.reflect.TypeToken<Map<?, ?>>() {
   
            }.getType();
            objMap = gson.fromJson(jsonStr, type);
        }
        return objMap;
    }
}

2、客户端帮助类

package ydj.plugins.pojo.erweima;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.ConnectionPoolTimeoutException;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn

你可能感兴趣的:(SpringBoot)