企业号:增加用户进入应用的callback事件&增加批量获取用户详情的接口

This commit is contained in:
jy.hu
2014-12-28 15:46:58 +08:00
parent 96b3080c2d
commit 3f4c174580
24 changed files with 143 additions and 37 deletions
@@ -34,7 +34,7 @@ public class BaseMsg implements Serializable {
}
public BaseMsg(String msgType) {
this(msgType, null, null);
this.msgType = msgType;
}
public BaseMsg(String toUserName, String fromUserName) {
@@ -0,0 +1,37 @@
package com.foxinmy.weixin4j.msg.event;
import com.foxinmy.weixin4j.type.EventType;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 用户进入应用的事件推送(企业号)本事件只有在应用的回调模式中打开上报开关时上报
*
* @className EnterAgentEventMessage
* @author jy
* @date 2014年12月28日
* @since JDK 1.7
* @see<a href=
* "http://qydev.weixin.qq.com/wiki/index.php?title=%E6%8E%A5%E6%94%B6%E4%BA%8B%E4%BB%B6#.E7.94.A8.E6.88.B7.E8.BF.9B.E5.85.A5.E5.BA.94.E7.94.A8.E7.9A.84.E4.BA.8B.E4.BB.B6.E6.8E.A8.E9.80.81"
* >用户进入应用的事件推送</a>
*/
public class EnterAgentEventMessage extends EventMessage {
private static final long serialVersionUID = 7675732524832500820L;
public EnterAgentEventMessage() {
super(EventType.enter_agent);
}
@XStreamAlias("EventKey")
private String eventKey; // 事件KEY值,与自定义菜单接口中KEY值对应
public String getEventKey() {
return eventKey;
}
@Override
public String toString() {
return "EnterAgentEventMessage [eventKey=" + eventKey + ", "
+ super.toString() + "]";
}
}
@@ -4,7 +4,7 @@ import com.foxinmy.weixin4j.type.EventType;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 模板消息事件推送
* 模板消息事件推送(公众平台)
*
* @className TemplatesendjobfinishMessage
* @author jy
@@ -37,6 +37,7 @@ public class MenuEventMessage extends EventMessage {
@Override
public String toString() {
return "eventKey=" + eventKey + ", " + super.toString();
return "MenuEventMessage [eventKey=" + eventKey + ", "
+ super.toString() + "]";
}
}
@@ -8,6 +8,7 @@ import com.foxinmy.weixin4j.msg.model.Base;
import com.foxinmy.weixin4j.msg.model.News;
import com.foxinmy.weixin4j.msg.model.Responseable;
import com.foxinmy.weixin4j.util.ClassUtil;
import com.foxinmy.weixin4j.xml.TextConverter;
import com.foxinmy.weixin4j.xml.XmlStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@@ -107,10 +108,7 @@ public class ResponseMessage extends BaseMsg {
@Override
public String toString() {
return "ResponseMessage [" + box.toString() + ", attach=" + attach
+ ", getToUserName()=" + getToUserName()
+ ", getFromUserName()=" + getFromUserName()
+ ", getCreateTime()=" + getCreateTime() + ", getMsgType()="
+ getMsgType() + "]";
return "ResponseMessage [ " + super.toString() + ", attach=" + attach
+ ", box=" + box + "]";
}
}
@@ -1,5 +1,6 @@
package com.foxinmy.weixin4j.type;
import com.foxinmy.weixin4j.msg.event.EnterAgentEventMessage;
import com.foxinmy.weixin4j.msg.event.EventMessage;
import com.foxinmy.weixin4j.msg.event.LocationEventMessage;
import com.foxinmy.weixin4j.msg.event.MassEventMessage;
@@ -31,7 +32,7 @@ public enum EventType {
MenuLocationEventMessage.class), click(MenuEventMessage.class), location(
LocationEventMessage.class),masssendjobfinish(
MassEventMessage.class), templatesendjobfinish(
TemplatesendjobfinishMessage.class);
TemplatesendjobfinishMessage.class),enter_agent(EnterAgentEventMessage.class);
private Class<? extends EventMessage> eventClass;
@@ -1,4 +1,4 @@
package com.foxinmy.weixin4j.response;
package com.foxinmy.weixin4j.xml;
import com.foxinmy.weixin4j.msg.model.Text;
import com.thoughtworks.xstream.converters.SingleValueConverter;