ReplyService.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using GxPress.Request.Reply;
  4. using GxPress.Result.Reply;
  5. using GxPress.Service.Interface.Reply;
  6. using System.Linq;
  7. using GxPress.Repository.Interface.Analyze;
  8. namespace GxPress.Service.Implement.Reply
  9. {
  10. /// <summary>
  11. /// 回复
  12. /// </summary>
  13. public partial class ReplyService : IReplyService
  14. {
  15. private readonly IAnalyzeRepository analyzeRepository;
  16. public ReplyService(IAnalyzeRepository analyzeRepository)
  17. {
  18. this.analyzeRepository = analyzeRepository;
  19. }
  20. /// <summary>
  21. /// 获取我收到和我回复的评论
  22. /// </summary>
  23. /// <param name="request"></param>
  24. /// <returns></returns>
  25. public async Task<IEnumerable<ReplyResult>> GetReplyResults(ReplyRequest request)
  26. {
  27. var result = new List<ReplyResult>();
  28. //话题本
  29. result.AddRange(await GetReplyNoteOrTopicResults(request));
  30. //小组话题
  31. result.AddRange(await GetReplyGroupTopicResults(request));
  32. if (request.TypeValue == 0)
  33. result.AddRange(await GetReceiptCommentResult(request));
  34. else
  35. result.AddRange(await GetMyReceiptCommentResult(request));
  36. //站内信 通知
  37. result.AddRange(await GetReplyNoticeTopicResults(request));
  38. var data = result.OrderByDescending(n => n.CreatedDate);
  39. return data;
  40. }
  41. }
  42. }