🎨 批量修复部分javadoc里的错误标签或不规范代码
This commit is contained in:
@@ -13,6 +13,11 @@ import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
|
||||
*/
|
||||
public interface WxMaConfig {
|
||||
|
||||
/**
|
||||
* 设置更新access_token之前的回调
|
||||
*
|
||||
* @param updateAccessTokenBefore 回调函数
|
||||
*/
|
||||
default void setUpdateAccessTokenBefore(Consumer<WxAccessTokenEntity> updateAccessTokenBefore) {}
|
||||
|
||||
/**
|
||||
@@ -23,8 +28,18 @@ public interface WxMaConfig {
|
||||
String getAccessToken();
|
||||
|
||||
// region 稳定版access token
|
||||
/**
|
||||
* 是否使用稳定版access_token
|
||||
*
|
||||
* @return 是否使用稳定版access_token
|
||||
*/
|
||||
boolean isStableAccessToken();
|
||||
|
||||
/**
|
||||
* 设置是否使用稳定版access_token
|
||||
*
|
||||
* @param useStableAccessToken 是否使用稳定版access_token
|
||||
*/
|
||||
void useStableAccessToken(boolean useStableAccessToken);
|
||||
|
||||
// endregion
|
||||
@@ -65,6 +80,12 @@ public interface WxMaConfig {
|
||||
*/
|
||||
void updateAccessToken(String accessToken, int expiresInSeconds);
|
||||
|
||||
/**
|
||||
* 更新access_token处理器
|
||||
*
|
||||
* @param accessToken 新的 access_token 值
|
||||
* @param expiresInSeconds 过期时间,单位:秒
|
||||
*/
|
||||
default void updateAccessTokenProcessor(String accessToken, int expiresInSeconds) {
|
||||
WxAccessTokenEntity wxAccessTokenEntity = new WxAccessTokenEntity();
|
||||
wxAccessTokenEntity.setAppid(getAppid());
|
||||
@@ -74,6 +95,11 @@ public interface WxMaConfig {
|
||||
updateAccessToken(accessToken, expiresInSeconds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新access_token之前的回调
|
||||
*
|
||||
* @param wxAccessTokenEntity access_token实体
|
||||
*/
|
||||
default void updateAccessTokenBefore(WxAccessTokenEntity wxAccessTokenEntity) {}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,7 @@ public class WxMaCryptUtils extends me.chanjar.weixin.common.util.crypto.WxCrypt
|
||||
* @param sessionKey session_key
|
||||
* @param encryptedData 消息密文
|
||||
* @param ivStr iv字符串
|
||||
* @return 解密后的字符串
|
||||
*/
|
||||
public static String decrypt(String sessionKey, String encryptedData, String ivStr) {
|
||||
try {
|
||||
@@ -58,6 +59,7 @@ public class WxMaCryptUtils extends me.chanjar.weixin.common.util.crypto.WxCrypt
|
||||
* @param sessionKey session_key
|
||||
* @param encryptedData 消息密文
|
||||
* @param ivStr iv字符串
|
||||
* @return 解密后的字符串
|
||||
*/
|
||||
public static String decryptAnotherWay(String sessionKey, String encryptedData, String ivStr) {
|
||||
byte[] keyBytes = Base64.decodeBase64(sessionKey.getBytes(UTF_8));
|
||||
|
||||
@@ -24,7 +24,12 @@ public class XStreamTransformer {
|
||||
}
|
||||
|
||||
/**
|
||||
* xml -> pojo.
|
||||
* {@code xml -> pojo.}
|
||||
*
|
||||
* @param <T> 返回类型
|
||||
* @param clazz 类型
|
||||
* @param xml xml字符串
|
||||
* @return 转换后的对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T fromXml(Class<T> clazz, String xml) {
|
||||
@@ -32,6 +37,14 @@ public class XStreamTransformer {
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code xml -> pojo.}
|
||||
*
|
||||
* @param <T> 返回类型
|
||||
* @param clazz 类型
|
||||
* @param is 输入流
|
||||
* @return 转换后的对象
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T fromXml(Class<T> clazz, InputStream is) {
|
||||
T object = (T) CLASS_2_XSTREAM_INSTANCE.get(clazz).fromXML(is);
|
||||
@@ -39,7 +52,12 @@ public class XStreamTransformer {
|
||||
}
|
||||
|
||||
/**
|
||||
* pojo -> xml.
|
||||
* {@code pojo -> xml.}
|
||||
*
|
||||
* @param <T> 类型参数
|
||||
* @param clazz 类型
|
||||
* @param object 对象
|
||||
* @return xml字符串
|
||||
*/
|
||||
public static <T> String toXml(Class<T> clazz, T object) {
|
||||
return CLASS_2_XSTREAM_INSTANCE.get(clazz).toXML(object);
|
||||
|
||||
Reference in New Issue
Block a user