Exemplo n.º 1
0
        public IActionResult GetPermanentMaterials()
        {
            var result = MateriaHelper.GetPermanentMaterialAsync("9esnqWhnAq2hOWtSkGD37eETYh7xL8AGrrS1DPisU5Y").Result;//9esnqWhnAq2hOWtSkGD37eETYh7xL8AGrrS1DPisU5Y

            if (result.file != null)
            {
                return(File(result.file, "application/octet-stream", result.message));
            }
            else
            {
                return(Ok(result.message));
            }
        }
Exemplo n.º 2
0
        public string Index()
        {
            var filePath = string.Format("/Images/result.jpg");
            //获取当前web目录
            var webRootPath = _hostingEnvironment.ContentRootPath + filePath;
            Task <M_APIResult <string> > result;

            using (FileStream fs = new FileStream(webRootPath, FileMode.Open, FileAccess.Read))
            {
                result = MateriaHelper.PostThumbAsync(fs, Summary.E_MaterialTime.Temporary);
            }
            return(result.Result.Data);
        }
Exemplo n.º 3
0
        public IActionResult GetTempMaterials()
        {
            var result = MateriaHelper.GetTemporaryMaterialAsync("SCgwH9dChZ7BBw1ZT-glla6ZFYJg5BHKKXKf4_UkxEhTH6FSTagsC0RwL12KY5fr").Result;

            if (result.file != null)
            {
                return(File(result.file, "application/octet-stream", result.message));
            }
            else
            {
                return(Ok(result.message));
            }
        }
Exemplo n.º 4
0
        public string Index2()
        {
            M_Articles entity = new M_Articles();

            entity.articles = new List <M_MaterialNews>();
            entity.articles.Add(new M_MaterialNews()
            {
                author            = "neekey", content = "test", content_source_url = "www.baidu.com", title = "图文消息测试", show_cover_pic = 1, digest = "",
                need_open_comment = 0, only_fans_can_comment = 0, thumb_media_id = "9esnqWhnAq2hOWtSkGD37V6uq4-1TAvxjNDrqy9NY2M"
            });
            var result = MateriaHelper.PostNewsAsync(entity);

            return(result.Result.Data);
        }
Exemplo n.º 5
0
        public IActionResult PostUpdateNewsAsync()
        {
            var entity = new M_MaterialNews()
            {
                author             = "neekey2",
                content            = "test2",
                content_source_url = "www.qq.com",
                title                 = "图文消息测试",
                show_cover_pic        = 1,
                digest                = "",
                need_open_comment     = 1,
                only_fans_can_comment = 1,
                thumb_media_id        = "9esnqWhnAq2hOWtSkGD37V6uq4-1TAvxjNDrqy9NY2M"
            };
            var result = MateriaHelper.PostUpdateNewsAsync("9esnqWhnAq2hOWtSkGD37eETYh7xL8AGrrS1DPisU5Y", entity).Result;

            return(Ok(result.Data));
        }
Exemplo n.º 6
0
        public string BatchNews()
        {
            M_Articles entity = new M_Articles();

            entity.articles = new List <M_MaterialNews>();
            entity.articles.Add(new M_MaterialNews()
            {
                author             = "neekey",
                content            = "test",
                content_source_url = "www.baidu.com",
                title                 = "图文消息测试",
                show_cover_pic        = 1,
                digest                = "",
                need_open_comment     = 0,
                only_fans_can_comment = 0,
                thumb_media_id        = "uc_4UZM-fWBuUlHiXsWTMDnOzUDuwJ4lECSSJqgO7qA6WhGEfeIUROTs1KtCi5NI"
            });
            var result = MateriaHelper.PostBatchNewsAsync(entity);

            return(result.Result.Data);
        }
Exemplo n.º 7
0
        public string GetMaterialsList()
        {
            string count = MateriaHelper.GetMaterialCount().Result.Data;

            return(MateriaHelper.GetMaterialList(Summary.E_MaterialType.Image, 0, 20).Result.Data);
        }
Exemplo n.º 8
0
        public IActionResult DelPermanentMaterials()
        {
            var result = MateriaHelper.PostDeleteMaterialAsync("9esnqWhnAq2hOWtSkGD37U9DSPhaLwWTf3eE-ehcrgo").Result;//9esnqWhnAq2hOWtSkGD37eETYh7xL8AGrrS1DPisU5Y

            return(Ok(result.Data));
        }