Пример #1
0
        public string GetFriendInfo()
        {
            GetFriendInfoParams actionParams = JavaScriptConvert.DeserializeObject <GetFriendInfoParams>(JsonParams);

            ShortUserInfo shortInfo = Forum.Users.GetShortUserInfo(actionParams.Uid);
            UserInfo      user      = new UserInfo();

            user.Uid      = shortInfo.Uid;
            user.UserName = shortInfo.Username;

            GetFriendInfoResponse gfiResponse = new GetFriendInfoResponse();

            gfiResponse.TotalNum = Forum.Friendship.GetUserFriendsCount(user.Uid);
            gfiResponse.Me       = user;

            List <FriendshipInfo> friendshipList = Friendship.GetUserFriendsList(user.Uid, 1, actionParams.ShowFriendsNum);
            List <Friend>         friendList     = new List <Friend>();

            foreach (FriendshipInfo info in friendshipList)
            {
                friendList.Add(new Friend(info.FriendUid, info.FriendUserName.Trim()));
            }

            gfiResponse.Friends = friendList;

            return(GetResult(gfiResponse));
        }
Пример #2
0
        public string GetFriendInfo()
        {
            GetFriendInfoParams actionParams = JavaScriptConvert.DeserializeObject<GetFriendInfoParams>(JsonParams);

            ShortUserInfo shortInfo = Forum.Users.GetShortUserInfo(actionParams.Uid);
            UserInfo user = new UserInfo();
            user.Uid = shortInfo.Uid;
            user.UserName = shortInfo.Username;

            GetFriendInfoResponse gfiResponse = new GetFriendInfoResponse();
            gfiResponse.TotalNum = Forum.Friendship.GetUserFriendsCount(user.Uid);
            gfiResponse.Me = user;

            List<FriendshipInfo> friendshipList = Friendship.GetUserFriendsList(user.Uid, 1, actionParams.ShowFriendsNum);
            List<Friend> friendList = new List<Friend>();

            foreach (FriendshipInfo info in friendshipList)
            {
                friendList.Add(new Friend(info.FriendUid, info.FriendUserName.Trim()));
            }

            gfiResponse.Friends = friendList;

            return GetResult(gfiResponse);
        }