|
@@ -23,6 +23,7 @@ using GxPress.Service.Interface.Article;
|
|
|
using GxPress.Service.Interface.Collection;
|
|
|
using GxPress.Service.Interface.Middle;
|
|
|
using GxPress.Service.Interface.UserMiddle;
|
|
|
+using GxPress.Repository.Interface.Media;
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
namespace GxPress.Service.Implement.Collection
|
|
@@ -46,11 +47,12 @@ namespace GxPress.Service.Implement.Collection
|
|
|
private readonly IAnalyzeService _analyzeService;
|
|
|
private readonly IFileLibraryRepository fileLibraryRepository;
|
|
|
private readonly IUserMiddleService _userMiddleService;
|
|
|
+ private readonly IMediaRepository mediaRepository;
|
|
|
public CollectionService(ICollectionRepository collectionRepository, IMiddleService middleService,
|
|
|
IArticleRepository articleRepository, ITopicRepository topicRepository, IMiddleRepository middleRepository,
|
|
|
INoteRepository noteRepository, IUserRepository userRepository, IArticleService articleService, INoticeRepository noticeRepository,
|
|
|
IMissiveRepository missiveRepository, IMapper mapper,
|
|
|
- IGroupRepository groupRepository, IMeetingSummaryRepository meetingSummaryRepository, IFolderUserRepository folderUserRepository, IAnalyzeService analyzeService, IFileLibraryRepository fileLibraryRepository, IUserMiddleService userMiddleService)
|
|
|
+ IGroupRepository groupRepository, IMeetingSummaryRepository meetingSummaryRepository, IFolderUserRepository folderUserRepository, IAnalyzeService analyzeService, IFileLibraryRepository fileLibraryRepository, IUserMiddleService userMiddleService, IMediaRepository mediaRepository)
|
|
|
{
|
|
|
_collectionRepository = collectionRepository;
|
|
|
_middleService = middleService;
|
|
@@ -69,6 +71,7 @@ namespace GxPress.Service.Implement.Collection
|
|
|
_analyzeService = analyzeService;
|
|
|
this.fileLibraryRepository = fileLibraryRepository;
|
|
|
_userMiddleService = userMiddleService;
|
|
|
+ this.mediaRepository = mediaRepository;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -112,6 +115,14 @@ namespace GxPress.Service.Implement.Collection
|
|
|
await _analyzeService.DeleteAsync(analyze.Id);
|
|
|
return true;
|
|
|
}
|
|
|
+ //收藏媒体
|
|
|
+ if (request.CollectionType == AllTypeConst.Book.GetHashCode() || request.CollectionType == AllTypeConst.Curriculum.GetHashCode() || request.CollectionType == AllTypeConst.Audio.GetHashCode() || request.CollectionType == AllTypeConst.Video.GetHashCode())
|
|
|
+ {
|
|
|
+ var media = await mediaRepository.GetAsync(request.CollectionDataId);
|
|
|
+ collection.Title = media.Title;
|
|
|
+ analyzeRequest.TypeValue = request.CollectionType;
|
|
|
+ await _analyzeService.SetAnalyzeAsync(analyzeRequest);
|
|
|
+ }
|
|
|
//收藏文章
|
|
|
if (request.CollectionType == AllTypeConst.Article.GetHashCode())
|
|
|
{
|