|
@@ -13,6 +13,7 @@ using GxPress.Common.Exceptions;
|
|
using GxPress.Common.Page;
|
|
using GxPress.Common.Page;
|
|
using GxPress.Request.Media;
|
|
using GxPress.Request.Media;
|
|
using System;
|
|
using System;
|
|
|
|
+using GxPress.EnumConst;
|
|
|
|
|
|
namespace GxPress.Repository.Implement.Media
|
|
namespace GxPress.Repository.Implement.Media
|
|
{
|
|
{
|
|
@@ -459,36 +460,40 @@ namespace GxPress.Repository.Implement.Media
|
|
if (request.DataTypeValue > 0)
|
|
if (request.DataTypeValue > 0)
|
|
{
|
|
{
|
|
//1 热搜
|
|
//1 热搜
|
|
- if (request.DataTypeValue == 1)
|
|
|
|
|
|
+ if (request.DataTypeValue == RankingListConst.HotSearch.GetHashCode())
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
//2热书榜
|
|
//2热书榜
|
|
- if (request.DataTypeValue == 2)
|
|
|
|
|
|
+ if (request.DataTypeValue == RankingListConst.ReadBook.GetHashCode())
|
|
{
|
|
{
|
|
- query.Where(nameof(Entity.tede2.Media.Media.MediaType), 20);
|
|
|
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.MediaType), ResourceTypeConst.Book.GetHashCode());
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
}
|
|
}
|
|
- if (request.DataTypeValue == 3)
|
|
|
|
|
|
+ //3 课程榜
|
|
|
|
+ if (request.DataTypeValue == RankingListConst.Article.GetHashCode())
|
|
{
|
|
{
|
|
- query.Where(nameof(Entity.tede2.Media.Media.MediaType), 100);
|
|
|
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.MediaType), ResourceTypeConst.Article.GetHashCode());
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
}
|
|
}
|
|
- if (request.DataTypeValue == 4)
|
|
|
|
|
|
+ //Top 100 新书
|
|
|
|
+ if (request.DataTypeValue == RankingListConst.NewBook.GetHashCode())
|
|
{
|
|
{
|
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.MediaType), ResourceTypeConst.Book.GetHashCode());
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.CreatedDate));
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.CreatedDate));
|
|
}
|
|
}
|
|
- if (request.DataTypeValue == 5)
|
|
|
|
|
|
+ //文献头条
|
|
|
|
+ if (request.DataTypeValue == RankingListConst.ArticleTop.GetHashCode())
|
|
{
|
|
{
|
|
- query.Where(nameof(Entity.tede2.Media.Media.MediaType), 100);
|
|
|
|
- query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
|
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.MediaType), ResourceTypeConst.Article.GetHashCode());
|
|
|
|
+ query.OrderByDesc(nameof(Entity.tede2.Media.Media.IsTop));
|
|
}
|
|
}
|
|
- if (request.DataTypeValue == 6)
|
|
|
|
|
|
+ if (request.DataTypeValue == RankingListConst.Audio.GetHashCode())
|
|
{
|
|
{
|
|
- query.Where(nameof(Entity.tede2.Media.Media.MediaType), 40);
|
|
|
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.MediaType), ResourceTypeConst.Audio.GetHashCode());
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.ReadCount));
|
|
}
|
|
}
|
|
- if (request.DataTypeValue == 7)
|
|
|
|
|
|
+ if (request.DataTypeValue == RankingListConst.HotComment.GetHashCode())
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.CommentScore));
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.CommentScore));
|
|
- if (request.DataTypeValue == 8)
|
|
|
|
|
|
+ if (request.DataTypeValue == RankingListConst.CollectionBook.GetHashCode())
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.CollectCount));
|
|
query.OrderByDesc(nameof(Entity.tede2.Media.Media.CollectCount));
|
|
}
|
|
}
|
|
query.Where(nameof(Entity.tede2.Media.Media.IsChecked), true);
|
|
query.Where(nameof(Entity.tede2.Media.Media.IsChecked), true);
|