李昊 4 anos atrás
pai
commit
2e75fca3d3

+ 10 - 0
gx_api/GxPress/Api/GxPress.Api/AdminControllers/AdminUserController.cs

@@ -277,5 +277,15 @@ namespace GxPress.Api.AdminControllers
             }
             return result;
         }
+        /// <summary>
+        /// 修改用户黑名单
+        /// </summary>
+        /// <param name="request"></param>
+        /// <returns></returns>
+        [HttpPut("update-disable")]
+        public async Task<bool> UpdateUserAsync(UserUpdateDisableRequest request)
+        {
+            return await _userRepository.UpdateDisableAsync(request);
+        }
     }
 }

+ 19 - 1
gx_api/GxPress/Model/GxPress.Request/User/UserRequest.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using GxPress.Common.Page;
 
 namespace GxPress.Request.User
@@ -253,7 +254,24 @@ namespace GxPress.Request.User
         /// 续费次数
         /// </summary>
         /// <value></value>
-       
+
         public int RenewalCount { get; set; }
     }
+    /// <summary>
+    /// 修改用户
+    /// </summary>
+    public class UserUpdateDisableRequest
+    {
+        /// <summary>
+        /// id
+        /// </summary>
+        /// <value></value>
+        public List<int> Ids { get; set; }
+        /// <summary>
+        /// 启用
+        /// </summary>
+        /// <value></value>
+        public bool IsDisable { get; set; }
+    }
+
 }

+ 3 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/Media/MediaRepository.cs

@@ -47,6 +47,9 @@ namespace GxPress.Repository.Implement.Media
             //获取媒体
             var media = await _repository.GetAsync(id);
             result = _mapper.Map<MediaResult>(media);
+            result.CategoryId = StringUtils.StringCollectionToStringList(media.CategoryId).ToList();
+            result.CategoryName = StringUtils.StringCollectionToStringList(media.CategoryName).ToList();
+            result.FullCategoryId = StringUtils.StringCollectionToStringList(media.FullCategoryId).ToList();
             //获取媒体库资源
             var mediaLibrarys = await mediaLibraryRepository.GetAllAsync(Q.Where(nameof(Entity.tede2.Media.MediaLibrary.MediaId), id));
             result.MediaLibraryResults = mediaLibrarys.ToList().Select(n => _mapper.Map<MediaLibraryResult>(n)).ToList();

+ 4 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/UserRepository.cs

@@ -194,7 +194,10 @@ namespace GxPress.Repository.Implement
         {
             return await _repository.UpdateAsync(user);
         }
-
+        public async Task<bool> UpdateDisableAsync(UserUpdateDisableRequest request)
+        {
+            return await _repository.UpdateAsync(Q.WhereIn(nameof(User.Id), request.Ids).Set(nameof(User.IsDisable), request.IsDisable)) > 0;
+        }
         public async Task<int> GetCountAsync(int departmentId, int roleId, string keyword)
         {
             var query = Q.NewQuery();

+ 1 - 0
gx_api/GxPress/Repository/GxPress.Repository.Interface/IUserRepository.cs

@@ -232,5 +232,6 @@ namespace GxPress.Repository.Interface
         /// <param name="request"></param>
         /// <returns></returns>
         Task<PagedList<UserDetail>> GetUserVipDetail(UserSearchVipRequest request);
+        Task<bool> UpdateDisableAsync(UserUpdateDisableRequest request);
     }
 }