1
0
mirror of synced 2025-12-16 12:25:33 +08:00

优化代码,增加日志

This commit is contained in:
Binary Wang
2018-08-27 21:03:32 +08:00
parent 3bc2bbc208
commit 5f1290720e
21 changed files with 149 additions and 87 deletions

View File

@@ -6,7 +6,7 @@ import java.util.Map;
/**
* 微信开发所使用到的常量类.
*
* @author chanjarster & binarywang
* @author Daniel Qian & binarywang
*/
public class WxConsts {
/**

View File

@@ -4,6 +4,8 @@ import me.chanjar.weixin.common.error.WxErrorException;
/**
* WxErrorException处理器.
*
* @author Daniel Qian
*/
public interface WxErrorExceptionHandler {

View File

@@ -5,6 +5,8 @@ package me.chanjar.weixin.common.api;
* 消息重复检查器.
* 微信服务器在五秒内收不到响应会断掉连接,并且重新发起请求,总共重试三次
* </pre>
*
* @author Daniel Qian
*/
public interface WxMessageDuplicateChecker {

View File

@@ -9,6 +9,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
* 默认消息重复检查器.
* 将每个消息id保存在内存里每隔5秒清理已经过期的消息id每个消息id的过期时间是15秒
* </pre>
*
* @author Daniel Qian
*/
public class WxMessageInMemoryDuplicateChecker implements WxMessageDuplicateChecker {

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,5 +1,9 @@
package me.chanjar.weixin.common.session;
/**
*
* @author Daniel Qian
*/
public interface InternalSession {
/**

View File

@@ -1,5 +1,8 @@
package me.chanjar.weixin.common.session;
/**
* @author Daniel Qian
*/
public interface InternalSessionManager {
/**

View File

@@ -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 {
/**

View File

@@ -2,6 +2,9 @@ package me.chanjar.weixin.common.session;
import java.util.Enumeration;
/**
* @author Daniel Qian
*/
public class StandardSessionFacade implements WxSession {
/**

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -2,6 +2,9 @@ package me.chanjar.weixin.common.session;
import java.util.Enumeration;
/**
* @author Daniel Qian
*/
public interface WxSession {
Object getAttribute(String name);

View File

@@ -1,5 +1,8 @@
package me.chanjar.weixin.common.session;
/**
* @author Daniel Qian
*/
public interface WxSessionManager {
/**