50 lines
1.6 KiB
C#
50 lines
1.6 KiB
C#
using System;
|
|
using WeChatServerServices.Model;
|
|
using WX.CRM.Common;
|
|
|
|
namespace WeChatServerServices.WxJob
|
|
{
|
|
public class Wx_GetFriendByMsg
|
|
{
|
|
static bool isRuning = false;
|
|
//读取队列
|
|
public static void ReadQueue()
|
|
{
|
|
if (isRuning)
|
|
return;
|
|
isRuning = true;
|
|
try
|
|
{
|
|
//new Subscribe().Act<message>("messagefriend", extractToBeFriendsDataFromMsg);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error("Wx_GetFriendByMsgJob出现错误" + ex.ToString());
|
|
}
|
|
finally
|
|
{
|
|
isRuning = false;
|
|
}
|
|
}
|
|
private static void extractToBeFriendsDataFromMsg(message content)
|
|
{
|
|
try
|
|
{
|
|
//WX_RCONTACT_BL _rcontact = new WX_RCONTACT_BL();
|
|
//decimal pici = _rcontact.extractToBeFriendsDataFromMsg(content.type.Value, content.talker, content.username, content.msgSvrId.Value.ToString(), content.content, DateTimeTool.GetTimeFromLinuxTime(content.createTime.Value));
|
|
|
|
//if (pici > 0)
|
|
//{
|
|
// MsgHelper msg = new MsgHelper(EnumMsgs.SendMsg);
|
|
// var messageDto = new MessageQueueDTO() { MsgType = pici, MsgData = "web_push_updateUser" };
|
|
// msg.SendMsg(messageDto);//触发推送通知
|
|
//}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error(ex.ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|