李昊 il y a 4 ans
Parent
commit
32648dcf12

+ 5 - 0
gx_api/GxPress/Model/GxPress.Result/App/Group/GroupDetailResult.cs

@@ -116,6 +116,11 @@ namespace GxPress.Result.App.Group
         /// </summary>
         /// <value></value>
         public string HistoryAvatarUrl { get; set; }
+        /// <summary>
+        /// 是否申请中
+        /// </summary>
+        /// <value></value>
+        public bool IsApply { get; set; }
     }
     /// <summary>
     /// 用户小组列表

+ 9 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Group/GroupService.cs

@@ -11,6 +11,7 @@ using GxPress.Common.Tools;
 using GxPress.Entity;
 using GxPress.EnumConst;
 using GxPress.Repository.Interface;
+using GxPress.Repository.Interface.AdminVerify;
 using GxPress.Request.App.AdminVerify;
 using GxPress.Request.App.Group;
 using GxPress.Request.App.GroupUser;
@@ -33,11 +34,11 @@ namespace GxPress.Service.Implement.Group
         private readonly IMiddleRepository _middleRepository;
         private readonly IMapper _mapper;
         private readonly IUserRepository _userRepository;
-
+        private readonly IAdminVerifyRepository adminVerifyRepository;
         public GroupService(IGroupRepository groupRepository, IGroupUserRepository groupUserRepository,
             ITopicRepository topicRepository, IMiddleService middleService,
             IAdminVerifyInsertService adminVerifyService, IMiddleRepository middleRepository, IMapper mapper,
-            IUserRepository userRepository)
+            IUserRepository userRepository, IAdminVerifyRepository adminVerifyRepository)
         {
             _groupRepository = groupRepository;
             _groupUserRepository = groupUserRepository;
@@ -47,6 +48,7 @@ namespace GxPress.Service.Implement.Group
             _middleRepository = middleRepository;
             _mapper = mapper;
             _userRepository = userRepository;
+            this.adminVerifyRepository = adminVerifyRepository;
         }
 
         /// <summary>
@@ -230,6 +232,11 @@ namespace GxPress.Service.Implement.Group
         {
             var result = await _groupRepository.GroupDetailAsync(request);
             var user = await _userRepository.GetAsync(result.UserId);
+            if (result.IsUser == false)
+            {
+                var adminVerify = await adminVerifyRepository.GetAsync(Q.Where(nameof(Entity.AdminVerify.VerifyType), 3).Where(nameof(Entity.AdminVerify.SourceId), result.Id));
+                result.IsApply = adminVerify.DisposeType == 0;
+            }
             result.UserName = user.Name;
             result.GroupUserNumber = result.GroupUserListResult.Count();
             //获取小组话题数量