コード例 #1
0
ファイル: AtUserService.cs プロジェクト: x1987624/SNS
        /// <summary>
        /// 批量创建At用户
        /// </summary>
        /// <param name="userIds">用户Id集合</param>
        /// <param name="associateId">关联项Id</param>
        /// <param name="userId">添加at的用户Id</param>
        /// <param name="associateSubject">关联项标题</param>
        /// <returns></returns>
        public bool BatchCreateAtUser(List <long> userIds, long associateId, long userId, string associateSubject = "")
        {
            List <long> current_UserIds = atUserRepository.GetAtUserIds(associateId, tenantTypeId);
            List <long> insertUserIds   = userIds.Except(current_UserIds).ToList();

            EventBus <long, AtUserEventArgs> .Instance().OnBatchBefore(insertUserIds, new AtUserEventArgs(userId, tenantTypeId, associateId));

            bool isSuccess = atUserRepository.BatchCreateAtUser(userIds, associateId, tenantTypeId);

            //更新最后联系时间
            new FollowRepository().UpdateLastContactDate(userId, userIds);
            EventBus <long, AtUserEventArgs> .Instance().OnBatchAfter(insertUserIds, new AtUserEventArgs(userId, tenantTypeId, associateId));

            return(isSuccess);
        }
コード例 #2
0
 /// <summary>
 /// 获取用户关联内容的用户Id集合
 /// </summary>
 /// <param name="associateId">关联项Id</param>
 /// <returns></returns>
 public List <long> GetAtUserIds(long associateId)
 {
     return(atUserRepository.GetAtUserIds(associateId, tenantTypeId));
 }