WebClientUtils.java 554 Bytes
package com.viontech.fanxing.commons.utils;

import org.springframework.web.reactive.function.client.WebClient;

/**
 * .
 *
 * @author 谢明辉
 * @date 2022/1/4
 */

public class WebClientUtils {


    public static WebClient buildClient(String baseUrl) {

        WebClient.Builder builder = WebClient.builder();
        if (baseUrl != null) {
            builder = builder.baseUrl(baseUrl);
        }
        return builder.codecs(clientCodecConfigurer -> clientCodecConfigurer.defaultCodecs().maxInMemorySize(-1))
                .build();
    }
}