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)); } }
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); }
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)); } }
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); }
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)); }
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); }
public string GetMaterialsList() { string count = MateriaHelper.GetMaterialCount().Result.Data; return(MateriaHelper.GetMaterialList(Summary.E_MaterialType.Image, 0, 20).Result.Data); }
public IActionResult DelPermanentMaterials() { var result = MateriaHelper.PostDeleteMaterialAsync("9esnqWhnAq2hOWtSkGD37U9DSPhaLwWTf3eE-ehcrgo").Result;//9esnqWhnAq2hOWtSkGD37eETYh7xL8AGrrS1DPisU5Y return(Ok(result.Data)); }