更新注释
This commit is contained in:
parent
79d3a6bec7
commit
b273c59186
@ -117,11 +117,11 @@ public class WeixinMessageDispatcher {
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public void doDispatch(final ChannelHandlerContext context,
|
||||
final WeixinRequest request, final CruxMessageHandler messageHandler)
|
||||
final WeixinRequest request, final CruxMessageHandler cruxMessage)
|
||||
throws WeixinException {
|
||||
String messageKey = messageKeyDefiner.defineMessageKey(
|
||||
messageHandler.getMsgType(), messageHandler.getEventType(),
|
||||
messageHandler.getAccountType());
|
||||
cruxMessage.getMsgType(), cruxMessage.getEventType(),
|
||||
cruxMessage.getAccountType());
|
||||
Class<?> targetClass = messageMatcher.find(messageKey);
|
||||
Object message = request.getOriginalContent();
|
||||
if (targetClass != null) {
|
||||
|
||||
@ -26,7 +26,7 @@ import com.foxinmy.weixin4j.type.EventType;
|
||||
import com.foxinmy.weixin4j.type.MessageType;
|
||||
|
||||
/**
|
||||
* 微信消息匹配
|
||||
* 微信消息匹配(不够优雅,待改进)
|
||||
*
|
||||
* @className WeixinMessageMatcher
|
||||
* @author jy
|
||||
|
||||
@ -96,16 +96,16 @@ public class WeixinRequestHandler extends
|
||||
.addListener(ChannelFutureListener.CLOSE);
|
||||
return;
|
||||
}
|
||||
CruxMessageHandler messageHandler = CruxMessageHandler.parser(request
|
||||
CruxMessageHandler cruxMessage = CruxMessageHandler.parser(request
|
||||
.getOriginalContent());
|
||||
ctx.channel().attr(Consts.ENCRYPTTYPE_KEY)
|
||||
.set(request.getEncryptType());
|
||||
ctx.channel().attr(Consts.USEROPENID_KEY)
|
||||
.set(messageHandler.getFromUserName());
|
||||
.set(cruxMessage.getFromUserName());
|
||||
if (StringUtil.isBlank(aesToken.getAppid())) {
|
||||
ctx.channel().attr(Consts.ACCOUNTOPENID_KEY)
|
||||
.set(messageHandler.getToUserName());
|
||||
.set(cruxMessage.getToUserName());
|
||||
}
|
||||
messageDispatcher.doDispatch(ctx, request, messageHandler);
|
||||
messageDispatcher.doDispatch(ctx, request, cruxMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ import com.foxinmy.weixin4j.util.AesToken;
|
||||
* @author jy
|
||||
* @date 2014年10月12日
|
||||
* @since JDK 1.7
|
||||
* @see com.foxinmy.weixin4j.messagekey.WeixinMessageKeyDefiner
|
||||
* @see com.foxinmy.weixin4j.handler.WeixinMessageHandler
|
||||
* @see com.foxinmy.weixin4j.interceptor.WeixinMessageInterceptor
|
||||
* @see com.foxinmy.weixin4j.dispatcher.WeixinMessageDispatcher
|
||||
@ -51,7 +52,7 @@ public final class WeixinServerBootstrap {
|
||||
*/
|
||||
public final static int DEFAULT_WORKERTHREADS = 20;
|
||||
/**
|
||||
* 默认服务启动端口
|
||||
* 服务启动的默认端口
|
||||
*/
|
||||
public final static int DEFAULT_SERVERPORT = 30000;
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user