|
@@ -125,6 +125,8 @@ namespace GxPress.Service.Implement.Collection
|
|
|
{
|
|
|
var topic = await _topicRepository.GetAsync(request.CollectionDataId);
|
|
|
collection.Title = topic.Title;
|
|
|
+ if (string.IsNullOrEmpty(collection.Title))
|
|
|
+ collection.Title = GetCollctionTitle(topic.Content);
|
|
|
//收藏
|
|
|
analyzeRequest.TypeValue = request.CollectionType;
|
|
|
await _analyzeService.SetAnalyzeAsync(analyzeRequest);
|
|
@@ -145,24 +147,30 @@ namespace GxPress.Service.Implement.Collection
|
|
|
await _analyzeService.SetAnalyzeAsync(analyzeRequest);
|
|
|
var note = await _noteRepository.GetAsync(request.CollectionDataId);
|
|
|
collection.Title = note.Title;
|
|
|
+ if (string.IsNullOrEmpty(collection.Title))
|
|
|
+ collection.Title = GetCollctionTitle(note.Content);
|
|
|
}
|
|
|
//通知
|
|
|
- else if (request.CollectionType == AllTypeConst.Notice.GetHashCode())
|
|
|
+ else if (request.CollectionType == AllTypeConst.Inbox.GetHashCode())
|
|
|
{
|
|
|
//通知
|
|
|
analyzeRequest.TypeValue = request.CollectionType;
|
|
|
await _analyzeService.SetAnalyzeAsync(analyzeRequest);
|
|
|
var notice = await _noticeRepository.GetAsync(request.CollectionDataId);
|
|
|
collection.Title = notice.Title;
|
|
|
+ if (string.IsNullOrEmpty(collection.Title))
|
|
|
+ collection.Title = GetCollctionTitle(notice.Content);
|
|
|
}
|
|
|
//站内信
|
|
|
- else if (request.CollectionType == AllTypeConst.Missive.GetHashCode())
|
|
|
+ else if (request.CollectionType == AllTypeConst.Inbox.GetHashCode())
|
|
|
{
|
|
|
- var missive = await _missiveRepository.GetAsync(request.CollectionDataId);
|
|
|
- collection.Title = missive.Title;
|
|
|
+ var notice = await _noticeRepository.GetAsync(request.CollectionDataId);
|
|
|
+ collection.Title = notice.Title;
|
|
|
//站内信
|
|
|
analyzeRequest.TypeValue = request.CollectionType;
|
|
|
await _analyzeService.SetAnalyzeAsync(analyzeRequest);
|
|
|
+ if (string.IsNullOrEmpty(collection.Title))
|
|
|
+ collection.Title = GetCollctionTitle(notice.Content);
|
|
|
}
|
|
|
//收藏会议
|
|
|
if (request.CollectionType == AllTypeConst.Meeting.GetHashCode())
|
|
@@ -671,5 +679,28 @@ namespace GxPress.Service.Implement.Collection
|
|
|
var data = JsonConvert.DeserializeObject<List<CollectionContentJsonData>>(json);
|
|
|
return await AnalyzeAsync(data);
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="content"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string GetCollctionTitle(string content)
|
|
|
+ {
|
|
|
+ if (!string.IsNullOrEmpty(content))
|
|
|
+ {
|
|
|
+
|
|
|
+ var forCount = 1;
|
|
|
+ var contentJsonData = JsonConvert.DeserializeObject<List<ContentJsonData>>(content);
|
|
|
+ foreach (var jsonData in contentJsonData)
|
|
|
+ {
|
|
|
+ if (jsonData.TypeValue == AllTypeConst.Text.GetHashCode() && forCount == 1)
|
|
|
+ //文本
|
|
|
+ return jsonData.Text;
|
|
|
+ else
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
}
|
|
|
}
|