|
@@ -29,6 +29,7 @@ using GxPress.EnumConst;
|
|
|
using GxPress.Request.App.Analyze;
|
|
|
using GxPress.Result.Web;
|
|
|
using GxPress.Request.Web;
|
|
|
+using GxPress.Repository.Interface.Media;
|
|
|
|
|
|
namespace GxPress.Service.Implement.Note
|
|
|
{
|
|
@@ -52,11 +53,12 @@ namespace GxPress.Service.Implement.Note
|
|
|
private readonly IAnalyzeService _analyzeService;
|
|
|
private readonly IUserMiddleService _userMiddleService;
|
|
|
private readonly IRecordFolderRepository recordFolderRepository;
|
|
|
+ private readonly IMediaRepository mediaRepository;
|
|
|
public NoteService(IMiddleService middleService, INoteRepository noteRepository,
|
|
|
IMiddleRepository middleRepository, IMapper mapper, IUserRepository userRepository,
|
|
|
IArticleRepository articleRepository, INoticeRepository noticeRepository,
|
|
|
IMissiveRepository missiveRepository, ITopicRepository topicRepository, IGroupRepository groupRepository,
|
|
|
- ICollectionRepository collectionRepository, ICommentRepository commentRepository, IVisitRepository visitRepository, IVisitService visitService, IFolderUserRepository folderUserRepository, IAnalyzeService analyzeService, IUserMiddleService userMiddleService, IRecordFolderRepository recordFolderRepository)
|
|
|
+ ICollectionRepository collectionRepository, ICommentRepository commentRepository, IVisitRepository visitRepository, IVisitService visitService, IFolderUserRepository folderUserRepository, IAnalyzeService analyzeService, IUserMiddleService userMiddleService, IRecordFolderRepository recordFolderRepository, IMediaRepository mediaRepository)
|
|
|
{
|
|
|
_middleService = middleService;
|
|
|
_noteRepository = noteRepository;
|
|
@@ -77,6 +79,7 @@ namespace GxPress.Service.Implement.Note
|
|
|
_analyzeService = analyzeService;
|
|
|
_userMiddleService = userMiddleService;
|
|
|
this.recordFolderRepository = recordFolderRepository;
|
|
|
+ this.mediaRepository = mediaRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -156,6 +159,14 @@ namespace GxPress.Service.Implement.Note
|
|
|
}
|
|
|
foreach (var item in result.Items)
|
|
|
{
|
|
|
+ //是否摘录
|
|
|
+ if (item.MediaId > 0)
|
|
|
+ {
|
|
|
+ item.IsExtract = true;
|
|
|
+ var query = Q.NewQuery();
|
|
|
+ query.Where(nameof(Entity.tede2.Media.Media.Id), item.MediaId);
|
|
|
+ item.MediaNoteResult = await mediaRepository.GetAsync(query);
|
|
|
+ }
|
|
|
if (string.IsNullOrWhiteSpace(item.Content))
|
|
|
item.Content = "[]";
|
|
|
var contentJsonData = JsonConvert.DeserializeObject<List<ContentJsonData>>(item.Content);
|