mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
🆕 #1952 增加腾讯企点子模块,用于对接企点开放平台。
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package me.chanjar.weixin.qidian.util;
|
||||
|
||||
/**
|
||||
* @author alegria
|
||||
* @date 2020年12月26日
|
||||
*/
|
||||
public class WxQidianConfigStorageHolder {
|
||||
private final static ThreadLocal<String> THREAD_LOCAL = new ThreadLocal<String>() {
|
||||
@Override
|
||||
protected String initialValue() {
|
||||
return "default";
|
||||
}
|
||||
};
|
||||
|
||||
public static String get() {
|
||||
return THREAD_LOCAL.get();
|
||||
}
|
||||
|
||||
public static void set(String label) {
|
||||
THREAD_LOCAL.set(label);
|
||||
}
|
||||
|
||||
/**
|
||||
* 此方法需要用户根据自己程序代码,在适当位置手动触发调用,本SDK里无法判断调用时机
|
||||
*/
|
||||
public static void remove() {
|
||||
THREAD_LOCAL.remove();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package me.chanjar.weixin.qidian.util.json;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
/**
|
||||
* @author someone
|
||||
*/
|
||||
public class WxQidianGsonBuilder {
|
||||
|
||||
private static final GsonBuilder INSTANCE = new GsonBuilder();
|
||||
|
||||
static {
|
||||
INSTANCE.disableHtmlEscaping();
|
||||
}
|
||||
|
||||
public static Gson create() {
|
||||
return INSTANCE.create();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user