李昊 4 years ago
parent
commit
2fb95daf6d

+ 1 - 0
gx_api/GxPress/Model/GxPress.Mappings/MiddleLableMapping.cs

@@ -10,6 +10,7 @@ namespace GxPress.Mappings
         public MiddleLableMapping()
         {
             CreateMap<MiddleLable, MiddleLableResult>();
+            CreateMap<MiddleLableResult, MiddleLable>();
             CreateMap<MiddleLableInRequest, MiddleLable>();
             CreateMap<MiddleLableNexusUpRequest, MiddleLableNexus>();
         }

+ 11 - 16
gx_api/GxPress/Model/GxPress.Result/MiddleLable/MiddleLableResult.cs

@@ -16,43 +16,38 @@ namespace GxPress.Result.MiddleLable
         /// 导航栏ID
         /// </summary>
         /// <value></value>
-
+       
         public string Name { get; set; }
-        /// <summary>
-        /// 标签ID
-        /// </summary>
-        /// <value></value>
-
-        public string LabelId { get; set; }
+    
         /// <summary>
         /// 排序
         /// </summary>
         /// <value></value>
-
+       
         public int Sort { get; set; }
         /// <summary>
-        /// 是否禁用 1 设置 2取消
+        /// 是否禁用
         /// </summary>
         /// <value></value>
-
-        public int IsDisable { get; set; }
+       
+        public bool IsDisable { get; set; }
         /// <summary>
         /// 是否开启搜索
         /// </summary>
         /// <value></value>
-
-        public int IsSearch { get; set; }
+       
+        public bool IsSearch { get; set; }
         /// <summary>
         /// 是否开启轮播
         /// </summary>
         /// <value></value>
-
-        public int IsSlide { get; set; }
+       
+        public bool IsSlide { get; set; }
         /// <summary>
         /// 1 APP 2 首页频道  3首页精选
         /// </summary>
         /// <value></value>
-
+       
         public int TypeId { get; set; }
 
         /// <summary>

+ 10 - 1
gx_api/GxPress/Service/GxPress.Service.Implement/Navigation/MiddleLableService.cs

@@ -97,7 +97,16 @@ namespace GxPress.Service.Implement.Navigation
         public async Task<MiddleLableResult> GetMiddleLableResultAsync(int middleLableId)
         {
             var middleLable = await middleLableRepository.GetAsync(middleLableId);
-            var middleLableResult = _mapper.Map<MiddleLableResult>(middleLable);
+            var middleLableResult = new MiddleLableResult()
+            {
+                Id = middleLable.Id,
+                Name = middleLable.Name,
+                Sort = middleLable.Sort,
+                IsDisable = middleLable.IsDisable,
+                IsSearch = middleLable.IsSearch,
+                IsSlide = middleLable.IsSlide,
+                TypeId = middleLable.TypeId
+            };
             middleLableResult.MiddleLableNexusResults = new List<MiddleLableNexusResult>();
             var middleLableNexusList = await middleLableNexusRepository.GetAllTaskAsync(middleLableId);
             var systemLabels = await systemLabelRepository.GetAllAsync(middleLableNexusList.Select(n => n.LableId).ToList());