李昊 4 years ago
parent
commit
fcc265ae68

+ 12 - 0
gx_api/GxPress/Model/GxPress.Entity/Navigations/Navigation.cs

@@ -52,5 +52,17 @@ namespace GxPress.Entity.Navigations
         /// <value></value>
         [DataColumn]
         public int Terminal { get; set; }
+        /// <summary>
+        /// 路径
+        /// </summary>
+        /// <value></value>
+        [DataColumn]
+        public string ControllerUrl { get; set; }
+        /// <summary>
+        /// 路径
+        /// </summary>
+        /// <value></value>
+        [DataColumn]
+        public string ActionUrl { get; set; }
     }
 }

+ 12 - 0
gx_api/GxPress/Model/GxPress.Request/Navigation/NavigationRequest.cs

@@ -57,5 +57,17 @@ namespace GxPress.Request.Navigation
         /// <value></value>
 
         public int Terminal { get; set; }
+         /// <summary>
+        /// 路径
+        /// </summary>
+        /// <value></value>
+  
+        public string ControllerUrl { get; set; }
+        /// <summary>
+        /// 路径
+        /// </summary>
+        /// <value></value>
+      
+        public string ActionUrl { get; set; }
     }
 }

+ 10 - 0
gx_api/GxPress/Model/GxPress.Result/Navigation/NavigationResult.cs

@@ -133,6 +133,16 @@ namespace GxPress.Result.Navigation
         /// </summary>
         /// <value></value>
         public List<NavigationResult> Children { get; set; }
+         /// <summary>
+        /// 路径
+        /// </summary>
+        /// <value></value>
+        public string ControllerUrl { get; set; }
+        /// <summary>
+        /// 路径
+        /// </summary>
+        /// <value></value>
+        public string ActionUrl { get; set; }
 
     }
 }

+ 6 - 2
gx_api/GxPress/Repository/GxPress.Repository.Implement/Navigation/NavigationRepository.cs

@@ -80,6 +80,10 @@ namespace GxPress.Repository.Implement.Navigation
                     model.Sort = request.Sort;
                 if (request.Terminal > 0)
                     model.Terminal = request.Terminal;
+                if (!string.IsNullOrEmpty(request.ActionUrl))
+                    model.ActionUrl = request.ActionUrl;
+                if (!string.IsNullOrEmpty(request.ControllerUrl))
+                    model.ControllerUrl = request.ControllerUrl;
                 return await _repository.UpdateAsync(model);
             }
             return false;
@@ -180,9 +184,9 @@ namespace GxPress.Repository.Implement.Navigation
                     query.ForPage(1, 10);
                     var medias = await _mediaRepository.GetAllAsync(query);
                     navigationMediaResult.MediaResults = medias.Select(n => _mapper.Map<MediaResult>(n)).ToList();
-                    foreach (var itemMedia in  navigationMediaResult.MediaResults)
+                    foreach (var itemMedia in navigationMediaResult.MediaResults)
                     {
-                        itemMedia.ImageUrls=StringUtils.AddDomain(itemMedia.ImageUrls);
+                        itemMedia.ImageUrls = StringUtils.AddDomain(itemMedia.ImageUrls);
                     }
                     result.Add(navigationMediaResult);
                 }