Exemple #1
0
        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));
        }
Exemple #2
0
 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;
     }
 }
Exemple #3
0
        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
            }));
        }