This repository has been archived by the owner on Aug 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
51 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 31 additions & 31 deletions
62
...thankjava/wqq/test/qq/MessageHandler.java → ...hankjava/wqq/test/qq/MessageListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
package com.thankjava.wqq.test.qq; | ||
|
||
import com.thankjava.wqq.SmartQQClient; | ||
import com.thankjava.wqq.entity.msg.PollMsg; | ||
import com.thankjava.wqq.entity.msg.SendMsg; | ||
import com.thankjava.wqq.extend.NotifyListener; | ||
|
||
public class MessageHandler implements NotifyListener { | ||
|
||
@Override | ||
public void handler(SmartQQClient smartQQClient, PollMsg pollMsg) { | ||
switch (pollMsg.getMsgType()) { | ||
case message: | ||
smartQQClient.sendMsg(new SendMsg(pollMsg, "I Have Got Your Msg: `Friend`")); | ||
break; | ||
case group_message: | ||
smartQQClient.sendMsg(new SendMsg(pollMsg, "I Have Got Your Msg: `Group`")); | ||
break; | ||
case discu_message: | ||
smartQQClient.sendMsg(new SendMsg(pollMsg, "I Have Got Your Msg: `Discu`")); | ||
break; | ||
} | ||
} | ||
|
||
// sendMsg 接口能通过pollMsg得到msg的类型,然后自动回复该类型的msg | ||
// @Override | ||
// public void handler(SmartQQClient smartQQClient, PollMsg pollMsg) { | ||
// smartQQClient.sendMsg(new SendMsg(pollMsg, "I Have Got Your Msg")); | ||
// } | ||
|
||
} | ||
package com.thankjava.wqq.test.qq; | ||
|
||
import com.thankjava.wqq.SmartQQClient; | ||
import com.thankjava.wqq.entity.msg.PollMsg; | ||
import com.thankjava.wqq.entity.msg.SendMsg; | ||
import com.thankjava.wqq.extend.NotifyListener; | ||
|
||
public class MessageListener implements NotifyListener { | ||
|
||
@Override | ||
public void handler(SmartQQClient smartQQClient, PollMsg pollMsg) { | ||
switch (pollMsg.getMsgType()) { | ||
case message: | ||
smartQQClient.sendMsg(new SendMsg(pollMsg, "I Have Got Your Msg: `Friend`")); | ||
break; | ||
case group_message: | ||
smartQQClient.sendMsg(new SendMsg(pollMsg, "I Have Got Your Msg: `Group`")); | ||
break; | ||
case discu_message: | ||
smartQQClient.sendMsg(new SendMsg(pollMsg, "I Have Got Your Msg: `Discu`")); | ||
break; | ||
} | ||
} | ||
|
||
// sendMsg 接口能通过pollMsg得到msg的类型,然后自动回复该类型的msg | ||
// @Override | ||
// public void handler(SmartQQClient smartQQClient, PollMsg pollMsg) { | ||
// smartQQClient.sendMsg(new SendMsg(pollMsg, "I Have Got Your Msg")); | ||
// } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters