public async Task <IActionResult> GetArticleBySlug([FromHeader] string projectDomain, string slug) { WebArticleModel result = await _mediator.Send(new GetWebArticleQuery { ProjectDomain = projectDomain, Slug = slug }); if (result.Article == null) { return(NotFound()); } return(Ok(result)); }
private void UserInterfaceInit(WebArticleModel webArticle) { if (webArticle == null) { new PopToast("数据异常!").ShowPopup(); return; } MainContent.Visibility = Visibility.Visible; WaittingRing.Visibility = Visibility.Collapsed; if (webArticle != null) { WebArticle = webArticle.Data; TitleTextBlock.Text = webArticle.Data.Title; DigestTextBlock.Text = webArticle.Data.Digest; AuthorTextBlock.Text = webArticle.Data.Author; } }
public async Task <IActionResult> GetForwardedArticleByMask([FromHeader] string projectDomain, string mask) { WebArticleModel result = await _mediator.Send(new GetWebForwardedArticleQuery { ProjectDomain = projectDomain, Mask = mask }); if (result == null) { return(NotFound()); } return(Ok(new WebArticleSlugModel { Slug = result.Article.Slug })); }