|
|
@@ -8,6 +8,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
import java.text.MessageFormat; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.Map; |
|
|
@@ -26,15 +27,11 @@ public class OkHttpUtil { |
|
|
|
@Autowired private OkHttpClient okHttpClient; |
|
|
|
|
|
|
|
private static OkHttpUtil okHttpUtil; |
|
|
|
/** |
|
|
|
* spring会自动从ioc容器当中根据OkHttpUtil类型找到okHttpUtil,当做参数传进来 |
|
|
|
* |
|
|
|
*/ |
|
|
|
@Autowired |
|
|
|
public void setOkHttpUtil(OkHttpUtil okHttpUtil) { |
|
|
|
this.okHttpUtil = okHttpUtil; |
|
|
|
} |
|
|
|
|
|
|
|
@PostConstruct |
|
|
|
public void init() { |
|
|
|
okHttpUtil = this; |
|
|
|
} |
|
|
|
/** |
|
|
|
* 根据map获取get请求参数 |
|
|
|
* |
|
|
|