com.foxinmy.weixin4j.message.event.MenuEventMessage Maven / Gradle / Ivy
package com.foxinmy.weixin4j.message.event;
import javax.xml.bind.annotation.XmlElement;
import com.foxinmy.weixin4j.type.EventType;
/**
* 自定义菜单事件(view|click)
*
* @className MenuEventMessage
* @author jinyu([email protected])
* @date 2014年4月6日
* @since JDK 1.6
* @see 订阅号、服务号的菜单事件
* @see 企业号的菜单事件
*/
public class MenuEventMessage extends EventMessage {
private static final long serialVersionUID = -1049672447995366063L;
public MenuEventMessage() {
super(EventType.click.name());
}
public MenuEventMessage(EventType eventType) {
super(eventType.name());
}
/**
* 事件KEY值,与自定义菜单接口中KEY值对应
*/
@XmlElement(name = "EventKey")
private String eventKey;
/**
* 指菜单ID,如果是个性化菜单,则可以通过这个字段,知道是哪个规则的菜单被点击了。
*/
@XmlElement(name = "MenuID")
private String menuId;
public String getEventKey() {
return eventKey;
}
public String getMenuId() {
return menuId;
}
@Override
public String toString() {
return "MenuEventMessage [eventKey=" + eventKey + ", menuId=" + menuId
+ ", " + super.toString() + "]";
}
}