李昊 4 年之前
父节点
当前提交
c31d81c6dd

+ 8 - 1
gx_api/GxPress/Model/GxPress.Entity/tede2/Group/GroupCategroy.cs

@@ -14,12 +14,19 @@ namespace GxPress.Entity.tede2.Group
         /// <value></value>
         [DataColumn]
         public string PiazzaName { get; set; }
+
+        /// <summary>
+        /// 广场图标
+        /// </summary>
+        /// <value></value>
+        [DataColumn]
+        public string ImageUrls { get; set; }
         /// <summary>
         /// 父级ID
         /// </summary>
         /// <value></value>
         [DataColumn]
         public int ParentId { get; set; }
-       
+
     }
 }

+ 5 - 0
gx_api/GxPress/Model/GxPress.Result/Web/GroupCategoryResult.cs

@@ -16,6 +16,11 @@ namespace GxPress.Result.Web
         /// <value></value>
         public string PiazzaName { get; set; }
         /// <summary>
+        /// 图标
+        /// </summary>
+        /// <value></value>
+        public string ImageUrls { get; set;}
+        /// <summary>
         /// 父级ID
         /// </summary>
         /// <value></value>

+ 7 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/Group/GroupCategroyRepository.cs

@@ -39,6 +39,7 @@ namespace GxPress.Repository.Implement.Group
         /// <returns></returns>
         public async Task<int> InsertAsync(Entity.tede2.Group.GroupCategroy groupCategroy)
         {
+            groupCategroy.ImageUrls = StringUtils.RemoveDomain(groupCategroy.ImageUrls);
             return await _repository.InsertAsync(groupCategroy);
         }
 
@@ -51,6 +52,8 @@ namespace GxPress.Repository.Implement.Group
                     model.PiazzaName = groupCategroy.PiazzaName;
                 if (groupCategroy.ParentId > 0)
                     model.ParentId = groupCategroy.ParentId;
+                if (string.IsNullOrEmpty(groupCategroy.ImageUrls))
+                    model.ImageUrls = StringUtils.RemoveDomain(groupCategroy.ImageUrls);
                 return await _repository.UpdateAsync(groupCategroy);
             }
             return false;
@@ -87,6 +90,10 @@ namespace GxPress.Repository.Implement.Group
             var result = await _repository.GetAllAsync<GroupCategoryResult>(Q.Where(nameof(Entity.tede2.Group.GroupCategroy.ParentId), parentId));
             foreach (var item in result)
                 item.IsChildren = await _repository.ExistsAsync(Q.Where(nameof(Entity.tede2.Group.GroupCategroy.ParentId), item.Id));
+            foreach (var item in result)
+            {
+                item.ImageUrls = StringUtils.AddDomain(item.ImageUrls);
+            }
             return result;
         }
     }