lihao 4 年之前
父節點
當前提交
a9295186ce

+ 6 - 0
gx_api/GxPress/Model/GxPress.Entity/Collection.cs

@@ -64,5 +64,11 @@ namespace GxPress.Entity
         /// <value></value>
         [DataColumn]
         public bool IsTop { get; set; }
+        /// <summary>
+        /// 结果
+        /// </summary>
+        /// <value></value>
+        [DataColumn]
+        public string ResultJson { get; set; }
     }
 }

+ 5 - 0
gx_api/GxPress/Model/GxPress.Result/App/Collection/CollectionListPageResult.cs

@@ -45,6 +45,11 @@ namespace GxPress.Result.App.Collection
         /// 文件数量
         /// </summary>
         public int FileCount { get; set; }
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <value></value>
+        public string ResultJson { get; set; }
 
     }
 

+ 2 - 2
gx_api/GxPress/Repository/GxPress.Repository.Implement/Collection/CollectionRepository.cs

@@ -105,12 +105,12 @@ namespace GxPress.Repository.Implement.Collection
             query.Select(fileCount, "FileCount");
             query.Select(
                 "tede_middle.{Id,MiddleId,UserId,FolderName,FolderType,IsTop,ParentId,AttributeValue,RoleId}",
-                 "tede_collection.{Title,CollectionDataId,CollectionType,SourceUserId,Id as CollectionId,CreatedDate}"
+                 "tede_collection.{Title,CollectionDataId,CollectionType,SourceUserId,Id as CollectionId,CreatedDate,ResultJson}"
                 );
             result.Items = await _middleRepository.GetAllAsync<CollectionListPageResult>(query);
             return result;
         }
-       
+
         /// <summary>
         /// 根据ID获取收藏数据
         /// </summary>

+ 7 - 4
gx_api/GxPress/Service/GxPress.Service.Implement/Collection/CollectionService.cs

@@ -93,12 +93,14 @@ namespace GxPress.Service.Implement.Collection
                 UserId = request.UserId,
                 SourceUserId = request.SourceUserId,
                 EndCollectionDataId = request.CollectionDataId,
-                EndCollectionType = request.CollectionType
+                EndCollectionType = request.CollectionType,
             };
+            var resultJson = await StructCollectionData(request.CollectionDataId, request.CollectionType, request.SourceUserId);
+            collection.ResultJson = JsonConvert.SerializeObject(resultJson);
             var query = new SqlKata.Query();
             query.Where(nameof(Entity.Collection.UserId), request.UserId)
-                             .Where(nameof(Entity.Collection.CollectionType), request.CollectionType)
-                             .Where(nameof(Entity.Collection.CollectionDataId), request.CollectionDataId);
+                                 .Where(nameof(Entity.Collection.CollectionType), request.CollectionType)
+                                 .Where(nameof(Entity.Collection.CollectionDataId), request.CollectionDataId);
             if (request.SourceUserId > 0)
                 query.Where(nameof(Entity.Collection.SourceUserId), request.SourceUserId);
             //查询是否存在
@@ -247,6 +249,7 @@ namespace GxPress.Service.Implement.Collection
                 analyzeRequest.TypeValue = request.CollectionType;
                 await _analyzeService.SetAnalyzeAsync(analyzeRequest);
             }
+
             var collectionId = await _collectionRepository.InsertAsync(collection);
             //添加收藏信息
             var middleInsertTypeRequest = new MiddleInsertTypeRequest
@@ -565,7 +568,7 @@ namespace GxPress.Service.Implement.Collection
 
             //通知
             if (collectionType == GxPress.EnumConst.AllTypeConst.Notice.GetHashCode()
-             || collectionType == GxPress.EnumConst.AllTypeConst.Missive.GetHashCode() 
+             || collectionType == GxPress.EnumConst.AllTypeConst.Missive.GetHashCode()
              || collectionType == GxPress.EnumConst.AllTypeConst.Anonymity.GetHashCode())
             {
                 var notice = await _noticeRepository.GetAsync(collectionDataId);