Exemplo n.º 1
0
        public ActionResult Send(string ToUserName, string ContentBody, string MsgType)
        {
            MsgParams msgParams = new MsgParams();


            msgParams.touser = ToUserName;

            msgParams.msgtype = MsgType;

            MsgContent msgContent = new MsgContent();

            msgContent.content = ContentBody;

            msgParams.text = msgContent;

            string req0 = JsonConvert.SerializeObject(msgParams);

            string r1 = MsgService.Send(msgParams);

            return(Content(req0 + r1));

            //SendMsgResponse response =(SendMsgResponse)JsonConvert.DeserializeObject(MsgService.Send(msgParams),typeof(SendMsgResponse));
            //if (response.errcode == "0")
            //{
            //    return View("SendForm");
            //}else
            //{
            //    return View("SendError");
            //}
        }
Exemplo n.º 2
0
 public async Task Handle(MessageSentEvent @event)
 {
     await MsgService.Send(@event.Title, @event.Content, @event.RecipientId);
 }