优化代码,增加日志
This commit is contained in:
@@ -6,7 +6,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 微信开发所使用到的常量类.
|
||||
*
|
||||
* @author chanjarster & binarywang
|
||||
* @author Daniel Qian & binarywang
|
||||
*/
|
||||
public class WxConsts {
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,8 @@ import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
/**
|
||||
* WxErrorException处理器.
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public interface WxErrorExceptionHandler {
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ package me.chanjar.weixin.common.api;
|
||||
* 消息重复检查器.
|
||||
* 微信服务器在五秒内收不到响应会断掉连接,并且重新发起请求,总共重试三次
|
||||
* </pre>
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public interface WxMessageDuplicateChecker {
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
* 默认消息重复检查器.
|
||||
* 将每个消息id保存在内存里,每隔5秒清理已经过期的消息id,每个消息id的过期时间是15秒
|
||||
* </pre>
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public class WxMessageInMemoryDuplicateChecker implements WxMessageDuplicateChecker {
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package me.chanjar.weixin.common.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* access token.
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
@Data
|
||||
public class WxAccessToken implements Serializable {
|
||||
private static final long serialVersionUID = 8709719312922168909L;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package me.chanjar.weixin.common.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* jspai signature.
|
||||
*
|
||||
* @author chanjarster
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
|
||||
@@ -10,6 +10,11 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* menu button.
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
@Data
|
||||
public class WxMenuButton implements Serializable {
|
||||
private static final long serialVersionUID = -1070939403109776555L;
|
||||
|
||||
@@ -8,6 +8,11 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* menu rule.
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
@Data
|
||||
public class WxMenuRule implements Serializable {
|
||||
private static final long serialVersionUID = -4587181819499286670L;
|
||||
|
||||
@@ -8,6 +8,10 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import lombok.Data;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
@Data
|
||||
public class WxMediaUploadResult implements Serializable {
|
||||
private static final long serialVersionUID = 330834334738622341L;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package me.chanjar.weixin.common.session;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public interface InternalSession {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package me.chanjar.weixin.common.session;
|
||||
|
||||
/**
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public interface InternalSessionManager {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
package me.chanjar.weixin.common.session;
|
||||
|
||||
import me.chanjar.weixin.common.util.res.StringManager;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import me.chanjar.weixin.common.util.res.StringManager;
|
||||
|
||||
/**
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public class StandardSession implements WxSession, InternalSession {
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,9 @@ package me.chanjar.weixin.common.session;
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public class StandardSessionFacade implements WxSession {
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package me.chanjar.weixin.common.session;
|
||||
|
||||
import me.chanjar.weixin.common.util.res.StringManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import me.chanjar.weixin.common.util.res.StringManager;
|
||||
|
||||
/**
|
||||
* 基于内存的session manager
|
||||
* 基于内存的session manager.
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public class StandardSessionManager implements WxSessionManager, InternalSessionManager {
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ package me.chanjar.weixin.common.session;
|
||||
/**
|
||||
* An exception that indicates the maximum number of active sessions has been
|
||||
* reached and the server is refusing to create any new sessions.
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public class TooManyActiveSessionsException
|
||||
extends IllegalStateException {
|
||||
|
||||
@@ -2,6 +2,9 @@ package me.chanjar.weixin.common.session;
|
||||
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public interface WxSession {
|
||||
|
||||
Object getAttribute(String name);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package me.chanjar.weixin.common.session;
|
||||
|
||||
/**
|
||||
* @author Daniel Qian
|
||||
*/
|
||||
public interface WxSessionManager {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user