记得上下班打卡 | git大法好,push需谨慎

Commit 5a575225 authored by 张国柄's avatar 张国柄

opt;

parent c07360c2
...@@ -32,7 +32,7 @@ public class MqHandleUtil { ...@@ -32,7 +32,7 @@ public class MqHandleUtil {
*/ */
public boolean sendNotifyErrorQueue(PayNotifyReqBo payNotifyReqBo,String queueKey) { public boolean sendNotifyErrorQueue(PayNotifyReqBo payNotifyReqBo,String queueKey) {
try { try {
HashMap<String, String> map = ObjectUtil.hashMapStringAndString; HashMap<String, String> map = ObjectUtil.cloneHashMapStringAndString();
map.put("message", payNotifyReqBo.toString()); map.put("message", payNotifyReqBo.toString());
MapRecord<String, String, String> record = StreamRecords.mapBacked(map).withStreamKey(queueKey); MapRecord<String, String, String> record = StreamRecords.mapBacked(map).withStreamKey(queueKey);
stringRedisTemplate.opsForStream().add(record); stringRedisTemplate.opsForStream().add(record);
......
...@@ -4,10 +4,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,10 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alipay.api.request.AlipayTradeWapPayRequest; import com.alipay.api.request.AlipayTradeWapPayRequest;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.HashMap; import java.util.*;
import java.util.LinkedList;
import java.util.SortedMap;
import java.util.TreeMap;
/** /**
* @author AnJiabin <anjiabin@zhengzai.tv> * @author AnJiabin <anjiabin@zhengzai.tv>
...@@ -20,31 +17,22 @@ import java.util.TreeMap; ...@@ -20,31 +17,22 @@ import java.util.TreeMap;
*/ */
@Component @Component
public class ObjectUtil { public class ObjectUtil {
public static final LinkedList<Object[]> linkedListObj = new LinkedList<Object[]>(); private static final LinkedList<Object[]> linkedListObj = new LinkedList<Object[]>();
public static final LinkedList<String> linkedListStr = new LinkedList<String>(); private static final LinkedList<String> linkedListStr = new LinkedList<String>();
public static final HashMap<String, String> hashMapStringAndString = new HashMap<>(); private static final HashMap<String, String> hashMapStringAndString = new HashMap<>();
public static final SortedMap<String, Object> sortedMapStringAndObj = new TreeMap<>(); private static final AlipayTradeWapPayRequest alipayTradeWapPayRequest = new AlipayTradeWapPayRequest();
public static final AlipayTradeWapPayRequest alipayTradeWapPayRequest = new AlipayTradeWapPayRequest(); private static final JSONObject jsonObjectObj = new JSONObject();
public static final JSONObject jsonObjectObj = new JSONObject();
public static LinkedList<Object[]> cloneLinkedListObj() { public static LinkedList<Object[]> cloneLinkedListObj() {
linkedListObj.clear(); return (LinkedList<Object[]>) linkedListObj.clone();
return linkedListObj;
} }
public static LinkedList<String> cloneLinkedListStr() { public static LinkedList<String> cloneLinkedListStr() {
linkedListStr.clear(); return (LinkedList<String>) linkedListStr.clone();
return linkedListStr;
} }
public static HashMap<String, String> cloneHashMapStringAndString() { public static HashMap<String, String> cloneHashMapStringAndString() {
hashMapStringAndString.clear(); return (HashMap<String, String>) hashMapStringAndString.clone();
return hashMapStringAndString;
}
public static SortedMap<String, Object> cloneSortedMapStringAndObj() {
sortedMapStringAndObj.clear();
return sortedMapStringAndObj;
} }
public static AlipayTradeWapPayRequest cloneAlipayTradeWapPayRequest() { public static AlipayTradeWapPayRequest cloneAlipayTradeWapPayRequest() {
...@@ -52,6 +40,6 @@ public class ObjectUtil { ...@@ -52,6 +40,6 @@ public class ObjectUtil {
} }
public static JSONObject cloneJsonObjectObj() { public static JSONObject cloneJsonObjectObj() {
return jsonObjectObj; return (JSONObject) jsonObjectObj.clone();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment