/// <summary> /// 发送给所有商户 /// </summary> /// <param name="command">命令</param> /// <param name="message">消息</param> public void Send(EnumMessageCommand command, string message) { try { clientHub.Invoke("sendAllMessage", command, command.ToEnumDesc(), message).ContinueWith(t => { if (t.IsFaulted) { Logger.WriteLog(LogType.ERROR, "web发送消息错误" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff"), t.Exception); } }); } catch (Exception e) { Logger.WriteLog(LogType.ERROR, "web发送消息异常" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff"), e); } }
/// <summary> /// 发送给指定的商户号 /// </summary> /// <param name="command">命令</param> /// <param name="code">商户号</param> /// <param name="message">消息内容</param> public void Send(EnumMessageCommand command, string code, string message) { try { Logger.WriteLog(LogType.ERROR, string.Format("Command:{0},Code:{1},Message:{2}", command, code, message)); clientHub.Invoke("sendGroupMessage", command, command.ToEnumDesc(), message, code).ContinueWith(t => { if (t.IsFaulted) { Logger.WriteLog(LogType.ERROR, "web发送消息错误" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff"), t.Exception); } }); } catch (Exception e) { Logger.WriteLog(LogType.ERROR, "web发送消息异常" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff"), e); } }