public JsonResult <object> GetComment(GetCommentRequest request) { if (!_articleService.ExistData(request.ArticleID)) { throw new Exception("文章不存在"); } int listCount = 0; var list = _commentService.GetData(out listCount, request.ArticleID, request.PageIndex, request.PageSize); return(JsonNet(list, listCount)); }
public void TestGetComment() { var localName = "test_multi_pages.docx"; var remoteName = "TestGetComment.docx"; var fullName = Path.Combine(this.dataFolder, remoteName); int commentIndex = 0; this.StorageApi.PutCreate(fullName, null, null, File.ReadAllBytes(BaseTestContext.GetDataDir(BaseTestContext.CommonFolder) + localName)); var request = new GetCommentRequest(remoteName, commentIndex, this.dataFolder); var actual = this.WordsApi.GetComment(request); Assert.AreEqual(200, actual.Code); }
public async Task <Comment> GetCommentAsync(GetCommentRequest request, CancellationToken cancellationToken = default(CancellationToken)) { if (string.IsNullOrEmpty(request.CommentId)) { throw new ArgumentNullException(nameof(request.CommentId)); } if (string.IsNullOrEmpty(request.LinkId)) { throw new ArgumentNullException(nameof(request.LinkId)); } var listings = await Api.GetMultiListingAsync(string.Format(UrlConstants.LinkCommentsUrl, Name, request.LinkId), request, cancellationToken); return(listings.Last().OfType <Comment>().FirstOrDefault()); }
public JsonResult <object> GetComment(GetCommentRequest request) { var baseInfo = GetBaseInfo(); if (request == null) { return(JsonError("请求参数错误")); } if (request.ArticleID == Guid.Empty) { return(JsonError("文章ID错误")); } int listCount = 0; var list = _commentService.GetData(out listCount, request.ArticleID, request.PageIndex, request.PageSize); return(JsonNet(list, listCount)); }
public void TestGetComment() { string remoteFileName = "TestGetComment.docx"; this.UploadFileToStorage( remoteDataFolder + "/" + remoteFileName, null, null, File.ReadAllBytes(LocalTestDataFolder + localFile) ); var request = new GetCommentRequest( name: remoteFileName, commentIndex: 0, folder: remoteDataFolder ); var actual = this.WordsApi.GetComment(request); Assert.NotNull(actual.Comment); Assert.AreEqual("Comment 1" + "\r\n\r\n", actual.Comment.Text); }
public async Task <IHttpActionResult> GetAllComment([FromBody] GetCommentRequest request) { var result = await commentService.FindAll(request.Speech, request.Page); return(Json(result)); }
public Task StartAsync(CancellationToken cancellationToken) { var request = new GetCommentRequest(_options); return(_requestHandler.HandleAsync(request)); }