|
@@ -1,6 +1,7 @@
|
|
|
using System.Threading.Tasks;
|
|
|
using Datory;
|
|
|
using GxPress.Entity.Topic;
|
|
|
+using GxPress.EnumConst;
|
|
|
using GxPress.Repository.Interface;
|
|
|
using GxPress.Repository.Interface.Note;
|
|
|
using GxPress.Repository.Interface.Visit;
|
|
@@ -43,14 +44,14 @@ namespace GxPress.Service.Implement.Visit
|
|
|
visit.SourceId = sourceId;
|
|
|
await _visitRepository.InsertAsync(visit);
|
|
|
//修改访问量数量
|
|
|
- if (typeId == 1)
|
|
|
+ if (typeId == AllTypeConst.Article.GetHashCode())
|
|
|
{
|
|
|
var article = await _articleRepository.GetAsync(sourceId);
|
|
|
article.ReadCount++;
|
|
|
await _articleRepository.UpdateAsync(article);
|
|
|
}
|
|
|
//修改访问量数量
|
|
|
- if (typeId == 2)
|
|
|
+ if (typeId == AllTypeConst.Topic.GetHashCode())
|
|
|
{
|
|
|
var topic = await _topicRepository.GetAsync(sourceId);
|
|
|
topic.ReadCount++;
|
|
@@ -60,7 +61,7 @@ namespace GxPress.Service.Implement.Visit
|
|
|
.Where(nameof(TopicAddressee.TopicId), sourceId)
|
|
|
.Where(nameof(TopicAddressee.UserId), userId));
|
|
|
}
|
|
|
- if (typeId == 4)
|
|
|
+ if (typeId == AllTypeConst.Note.GetHashCode())
|
|
|
{
|
|
|
var note = await _noteRepository.GetAsync(sourceId);
|
|
|
note.ReadCount++;
|