Ejemplo n.º 1
0
 /// <summary>
 /// 查询文章列表并包含优选文章
 /// </summary>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <returns></returns>
 public static async Task <List <ArticleListModel> > SelectArticleListAndYouXuanList(int pageIndex, int pageSize) => await GetFromCacheAsync($"NewArticleList{pageIndex}/{pageSize}", () => ArticleSystem.SelectArticleListAndYouXuanList(pageIndex, pageSize), CacheTimeEnum.Quarter);
Ejemplo n.º 2
0
 /// <summary>
 /// 查询优选文章喜欢数
 /// </summary>
 /// <param name="articleId"></param>
 /// <returns></returns>
 public static async Task <int> SelectYouXuanFavoriteCountByArticleId(int articleId) => await GetFromCacheAsync($"YouXuanFavoriteCount/{articleId}", () => ArticleSystem.SelectYouXuanFavoriteCountByArticleId(articleId), CacheTimeEnum.Day);
Ejemplo n.º 3
0
 /// <summary>
 /// 根据文章ID 查询点赞用户
 /// </summary>
 /// <param name="articleId"></param>
 /// <returns></returns>
 public static async Task <List <string> > SelectArticleLikeUserListByArticleId(int articleId) => await GetFromCacheAsync($"VoteUserList/{articleId}", () => ArticleSystem.SelectArticleLikeUserListByArticleId(articleId), CacheTimeEnum.Short);
Ejemplo n.º 4
0
 /// <summary>
 /// 查询我喜欢的优选文章Ids
 /// </summary>
 /// <param name="userId"></param>
 /// <returns></returns>
 public static async Task <List <int> > SelectMyFavoriteYouXuanIdsByUserId(Guid userId) => await GetFromCacheAsync($"MyFavoriteYouXuanList/{userId.ToString()}", () => ArticleSystem.SelectMyFavoriteYouXuanIdsByUserId(userId), CacheTimeEnum.Hour);
Ejemplo n.º 5
0
 /// <summary>
 /// 相关阅读
 /// </summary>
 /// <param name="categoryTagId"></param>
 /// <returns></returns>
 public static async Task <List <RelatedArticleModel> > SelectRelateArticleByCategoryTagId(int categoryTagId) => await GetFromCacheAsync($"RelatedArticlesById/{categoryTagId}", () => ArticleSystem.SelectRelateArticleByCategoryTagId(categoryTagId), CacheTimeEnum.Hour);