Beispiel #1
0
        /// <summary>
        /// 忽略添加好友
        /// </summary>
        /// <param name="managerId"></param>
        /// <param name="friendId"></param>
        /// <returns></returns>
        public MessageCodeResponse IgnoreAddFriend(Guid managerId, Guid friendId)
        {
            int returnCode = 0;

            FriendManagerMgr.IgnoreAddFriend(managerId, friendId, ref returnCode);
            if (returnCode == -1)//已经是好友了
            {
                returnCode = 0;
            }
            return(ResponseHelper.Create <MessageCodeResponse>(returnCode));
        }
Beispiel #2
0
        public MyFriendsResponse DeleteFriend(Guid managerId, int recordId, int pageIndex, int pageSize)
        {
            var friend = FriendManagerMgr.GetById(recordId);

            if (friend == null || friend.ManagerId != managerId || friend.Status != 0)
            {
                return(ResponseHelper.InvalidParameter <MyFriendsResponse>());
            }
            if (FriendManagerMgr.Delete(friend.Idx, friend.RowVersion))
            {
                int returnCode = 0;
                FriendManagerMgr.IgnoreAddFriend(managerId, friend.FriendId, ref returnCode);

                return(GetMyFriends(managerId, pageIndex, pageSize));
            }
            else
            {
                return(ResponseHelper.Create <MyFriendsResponse>(MessageCode.NbUpdateFail));
            }
        }