コード例 #1
0
        public IActionResult tags(int?type = null, int?page = null, int?rt = null)
        {
            int pagenumber = 1;

            int tp = 0;

            if (type != null)
            {
                tp = (int)type;
            }

            if (page != null)
            {
                pagenumber = (int)page;
            }

            string sXml         = "";
            int    responsetype = 0; // 0: google, 1: bing

            if (rt != null)
            {
                responsetype = (int)rt;
            }

            switch (responsetype)
            {
            case 0:
                sXml = XMLBLL.Google_TagySitemap(_context, new TagEntity()
                {
                    ispublic   = true,
                    type       = (TagsBLL.Types)tp,
                    pagesize   = 50000,
                    pagenumber = pagenumber,
                    order      = "id desc"
                });
                break;

            case 1:
                sXml = XMLBLL.Bing_TagSitemap(_context, new TagEntity()
                {
                    ispublic   = true,
                    type       = (TagsBLL.Types)tp,
                    pagesize   = 50000,
                    pagenumber = pagenumber,
                    order      = "id desc"
                });
                break;
            }

            return(this.Content(sXml, "text/xml"));
        }
コード例 #2
0
        public async Task <IActionResult> categories(string rt = null, string type = null)
        {
            int tp = 0;

            if (type != null)
            {
                tp = Convert.ToInt32(type);
            }

            string sXml         = "";
            int    responsetype = 0; // 0: google, 1: bing

            if (rt != null)
            {
                responsetype = Convert.ToInt32(rt);
            }
            switch (responsetype)
            {
            case 0:
                sXml = await XMLBLL.Google_CategorySitemap(_context, new CategoryEntity()
                {
                    ispublic = true,
                    type     = tp,
                    pagesize = 50000,
                    order    = "id desc"
                });

                break;

            case 1:
                sXml = await XMLBLL.Bing_CategorySitemap(_context, new CategoryEntity()
                {
                    ispublic = true,
                    type     = tp,
                    pagesize = 50000,
                    order    = "id desc"
                });

                break;
            }

            return(this.Content(sXml, "text/xml"));
        }