李昊 5 years ago
parent
commit
14abf53196

+ 12 - 0
gx_api/GxPress/Api/GxPress.Api/AdminControllers/AdminSpecialLabelController.cs

@@ -1,6 +1,8 @@
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
+using GxPress.Common.Page;
 using GxPress.Repository.Interface.SpecialLabel;
 using GxPress.Repository.Interface.SpecialLabel;
+using GxPress.Request.SpecialLabel;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc;
 
 
@@ -69,5 +71,15 @@ namespace GxPress.Api.AdminControllers
         {
         {
             return await specialLabelRepository.GetAllAsync(typeValue);
             return await specialLabelRepository.GetAllAsync(typeValue);
         }
         }
+        /// <summary>
+        ///特使标签数据
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [HttpPost("list")]
+        public async Task<PagedList<Entity.SystemLabel.SpecialLabel>> GetAllAsync(SpecialLabelSearchRequest request)
+        {
+            return await specialLabelRepository.GetAllAsync(request);
+        }
     }
     }
 }
 }

+ 1 - 1
gx_api/GxPress/Model/GxPress.Entity/SystemLabel/SpecialLabel.cs

@@ -19,7 +19,7 @@ namespace GxPress.Entity.SystemLabel
         [DataColumn]
         [DataColumn]
         public string ImageUrls { get; set; }
         public string ImageUrls { get; set; }
         /// <summary>
         /// <summary>
-        /// 榜单 130 示范客厅 140  品牌专区1 150 品牌专区2 160 直播170
+        /// 榜单 130 示范客厅 140  品牌专区1 150 品牌专区2 160 直播 170
         /// </summary>
         /// </summary>
         /// <value></value>
         /// <value></value>
         [DataColumn]
         [DataColumn]

+ 23 - 0
gx_api/GxPress/Model/GxPress.Request/SpecialLabel/SpecialLabelRequest.cs

@@ -0,0 +1,23 @@
+namespace GxPress.Request.SpecialLabel
+{
+    public class SpecialLabelRequest
+    {
+
+    }
+    /// <summary>
+    /// 特使标签查询
+    /// </summary>
+    public class SpecialLabelSearchRequest:Common.Page.PageParameter
+    {
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <value></value>
+        public string KeyWord { get; set; }
+        /// <summary>
+        /// 榜单 130 示范客厅 140  品牌专区1 150 品牌专区2 160 直播 170
+        /// </summary>
+        /// <value></value>
+        public int TypeValue { get; set; }
+    }
+}

+ 20 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/SpecialLabel/SpecialLabelRepository.cs

@@ -3,8 +3,10 @@ using System.Threading.Tasks;
 using AutoMapper;
 using AutoMapper;
 using Datory;
 using Datory;
 using GxPress.Common.AppOptions;
 using GxPress.Common.AppOptions;
+using GxPress.Common.Page;
 using GxPress.Common.Tools;
 using GxPress.Common.Tools;
 using GxPress.Repository.Interface.SpecialLabel;
 using GxPress.Repository.Interface.SpecialLabel;
+using GxPress.Request.SpecialLabel;
 using Microsoft.Extensions.Options;
 using Microsoft.Extensions.Options;
 
 
 namespace GxPress.Repository.Implement.SpecialLabel
 namespace GxPress.Repository.Implement.SpecialLabel
@@ -87,5 +89,23 @@ namespace GxPress.Repository.Implement.SpecialLabel
             query.OrderByDesc(nameof(Entity.SystemLabel.SpecialLabel.Sort)).Take(8);
             query.OrderByDesc(nameof(Entity.SystemLabel.SpecialLabel.Sort)).Take(8);
             return await _repository.GetAllAsync(query);
             return await _repository.GetAllAsync(query);
         }
         }
+        /// <summary>
+        ///特使标签数据
+        /// </summary>
+        /// <param name="typeValue"></param>
+        /// <returns></returns>
+        public async Task<PagedList<Entity.SystemLabel.SpecialLabel>> GetAllAsync(SpecialLabelSearchRequest request)
+        {
+            var result = new PagedList<Entity.SystemLabel.SpecialLabel>();
+            var query = Q.NewQuery();
+            if (request.TypeValue > 0)
+                query.Where(nameof(Entity.SystemLabel.SpecialLabel.TypeValue), request.TypeValue);
+            if (!string.IsNullOrEmpty(request.KeyWord))
+                query.WhereLike(nameof(Entity.SystemLabel.SpecialLabel.Title), $"%{request.KeyWord}%");
+            result.Total = await _repository.CountAsync(query);
+            query.OrderByDesc(nameof(Entity.SystemLabel.SpecialLabel.Sort));
+            result.Items = await _repository.GetAllAsync(query);
+            return result;
+        }
     }
     }
 }
 }

+ 8 - 0
gx_api/GxPress/Repository/GxPress.Repository.Interface/SpecialLabel/ISpecialLabelRepository.cs

@@ -1,6 +1,8 @@
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using Datory;
 using Datory;
+using GxPress.Common.Page;
+using GxPress.Request.SpecialLabel;
 
 
 namespace GxPress.Repository.Interface.SpecialLabel
 namespace GxPress.Repository.Interface.SpecialLabel
 {
 {
@@ -36,5 +38,11 @@ namespace GxPress.Repository.Interface.SpecialLabel
         /// <param name="typeValue"></param>
         /// <param name="typeValue"></param>
         /// <returns></returns>
         /// <returns></returns>
         Task<IEnumerable<Entity.SystemLabel.SpecialLabel>> GetAllAsync(int typeValue);
         Task<IEnumerable<Entity.SystemLabel.SpecialLabel>> GetAllAsync(int typeValue);
+        /// <summary>
+        ///特使标签数据
+        /// </summary>
+        /// <param name="typeValue"></param>
+        /// <returns></returns>
+        Task<PagedList<Entity.SystemLabel.SpecialLabel>> GetAllAsync(SpecialLabelSearchRequest request);
     }
     }
 }
 }