public override void Execute(string argument) { WeChatAppMessageType messageType = (WeChatAppMessageType)Enum.Parse(typeof(WeChatAppMessageType), argument, true); WeChatAppMessageCollection appMessages = WeChatHelper.GetAppMessages(messageType, WeChatRequestContext.Current.LoginInfo); appMessages.Output(); }
protected override void ProcessResponseText(string responseText) { WeChatSendMessageRetInfo result = JSONSerializerExecute.Deserialize <WeChatSendMessageRetInfo>(responseText); if (result.ret != 0) { throw new ApplicationException(result.msg); } if (this.Message.AppMessageID <= 0) { this.ResponseMessage = WeChatHelper.GetAppMessages(this.Message.MessageType, this.LoginInfo).FirstOrDefault(); (this.ResponseMessage != null).FalseThrow("不能找到新保存的素材"); } else { this.ResponseMessage = this.Message; } }