Przeglądaj źródła

修改到docker外运行环境

tags/v1.0.0^2
林万龙 3 lat temu
rodzic
commit
01c93f2d02
2 zmienionych plików z 10 dodań i 11 usunięć
  1. +5
    -8
      src/main/java/com/telpo/dipperposition/common/OkHttpUtil.java
  2. +5
    -3
      src/main/java/com/telpo/dipperposition/common/RedisUtil.java

+ 5
- 8
src/main/java/com/telpo/dipperposition/common/OkHttpUtil.java Wyświetl plik

@@ -8,6 +8,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;


import javax.annotation.PostConstruct;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
@@ -26,15 +27,11 @@ public class OkHttpUtil {
@Autowired private OkHttpClient okHttpClient; @Autowired private OkHttpClient okHttpClient;


private static OkHttpUtil okHttpUtil; 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请求参数 * 根据map获取get请求参数
* *


+ 5
- 3
src/main/java/com/telpo/dipperposition/common/RedisUtil.java Wyświetl plik

@@ -6,6 +6,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;


import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -29,9 +30,10 @@ public class RedisUtil {
* spring会自动从ioc容器当中根据RedisUtil类型找到redisUtil,当做参数传进来 * spring会自动从ioc容器当中根据RedisUtil类型找到redisUtil,当做参数传进来
* *
*/ */
@Autowired
public void setRedisUtil(RedisUtil redisUtil) {
this.redisUtil = redisUtil;

@PostConstruct
public void init() {
redisUtil = this;
} }
// =============================common============================ // =============================common============================
/** /**


Ładowanie…
Anuluj
Zapisz