1 package com.foxinmy.weixin4j.mp.event;
2
3 import javax.xml.bind.annotation.XmlElement;
4 import javax.xml.bind.annotation.XmlTransient;
5
6 import com.foxinmy.weixin4j.message.event.EventMessage;
7 import com.foxinmy.weixin4j.type.EventType;
8
9
10
11
12
13
14
15
16
17
18
19 public class ScanEventMessage extends EventMessage {
20
21 private static final long serialVersionUID = 8078674062833071562L;
22
23 public ScanEventMessage() {
24 super(EventType.scan.name());
25 }
26
27 public ScanEventMessage(String eventType) {
28 super(eventType);
29 }
30
31
32
33
34 @XmlElement(name = "EventKey")
35 private String eventKey;
36
37
38
39 @XmlElement(name = "Ticket")
40 private String ticket;
41
42 public String getEventKey() {
43 return eventKey;
44 }
45
46 public String getTicket() {
47 return ticket;
48 }
49
50 @XmlTransient
51 public String getParameter() {
52 return eventKey.replaceFirst("qrscene_", "");
53 }
54
55 @Override
56 public String toString() {
57 return "ScanEventMessage [eventKey=" + eventKey + ", ticket=" + ticket
58 + ", " + super.toString() + "]";
59 }
60 }