Example #1
0
        public override string ReplyExecute(replyBase json)
        {
            RpArticles art = json as RpArticles;

            string resxml = string.Empty;
            int    count  = 0;

            resxml += string.Format(@"<xml>
                                            <ToUserName><![CDATA[{0}]]></ToUserName>  
                                            <FromUserName><![CDATA[{1}]]></FromUserName>  
                                            <CreateTime>{2}</CreateTime>  
                                            <MsgType><![CDATA[news]]></MsgType>  
                                            <ArticleCount>{3}</ArticleCount>  
                                            <Articles>",
                                    art.xmlmsg.ToUserName, art.xmlmsg.FromUserName, SerializeHelper.longtime().ToString(), art.newslist.Count);
            foreach (newslist itemArticles in art.newslist)
            {
                count++;
                if (count <= 10)
                {
                    resxml += string.Format(@"<item>  
                                            <Title><![CDATA[{0}]]></Title>   
                                            <Description><![CDATA[{1}]]></Description>  
                                            <PicUrl><![CDATA[{2}]]></PicUrl>  
                                            <Url><![CDATA[{3}]]></Url>  
                                            </item>",
                                            itemArticles.title, itemArticles.description, itemArticles.picUrl, itemArticles.url);
                }
            }
            resxml += "</Articles></xml>  ";
            return(resxml);
        }
Example #2
0
        public override string ReplyExecute(replyBase json)
        {
            string      xml   = @"<xml>
  <ToUserName><![CDATA[{0}]]></ToUserName>
  <FromUserName><![CDATA[{1}]]></FromUserName>
  <CreateTime>{2}</CreateTime>
  <MsgType><![CDATA[text]]></MsgType>
  <Content><![CDATA[{3}]]></Content>
</xml>";
            RequestText json1 = json as RequestText;

            xml = string.Format(xml, json.xmlmsg.ToUserName, json.xmlmsg.FromUserName, SerializeHelper.longtime().ToString(), json1.Content);
            return(xml);
        }
Example #3
0
        public override string ReplyExecute(replyBase json)
        {
            string       xml   = @"<xml>
  <ToUserName><![CDATA[{0}]]></ToUserName>
  <FromUserName><![CDATA[{1}]]></FromUserName>
  <CreateTime>{2}</CreateTime>
  <MsgType><![CDATA[image]]></MsgType>
  <Image>
    <MediaId><![CDATA[{3}]]></MediaId>
  </Image>
</xml>";
            RequestImage json1 = json as RequestImage;

            xml = string.Format(xml, json.xmlmsg.ToUserName, json.xmlmsg.FromUserName, SerializeHelper.longtime().ToString(), json1.Image.MediaId);
            return(xml);
        }
Example #4
0
        public override string ReplyExecute(replyBase json)
        {
            string       xml   = @"<xml>
                              <ToUserName><![CDATA[{0}]]></ToUserName>
                              <FromUserName><![CDATA[{1}]]></FromUserName>
                              <CreateTime>{2}</CreateTime>
                              <MsgType><![CDATA[video]]></MsgType>
                              <Video>
                                <MediaId><![CDATA[{3}]]></MediaId>
                                <Title><![CDATA[{4}]]></Title>
                                <Description><![CDATA[{5}]]></Description>
                              </Video>
                            </xml>";
            RequestVideo json1 = json as RequestVideo;

            xml = string.Format(xml, json.xmlmsg.ToUserName, json.xmlmsg.FromUserName, SerializeHelper.longtime().ToString(), json1.Video.MediaId, json1.Video.Title, json1.Video.Description);
            return(xml);
        }
Example #5
0
 /// <summary>
 /// 返回数据
 /// </summary>
 /// <param name="json"></param>
 /// <returns></returns>
 public abstract String ReplyExecute(replyBase json);