예제 #1
0
        /// <summary>
        /// 获取好友列表
        /// </summary>
        /// <returns>列表数据</returns>
        private RetJsonData Action_GetFriendList()
        {
            Sdk_ContactInfo friendList = ApiPlugin.GetFriendList();

            if (friendList == null)
            {
                return(new RetJsonData()
                {
                    Code = 404, Msg = "未获取到列表"
                });
            }

            // 遍历所有成员
            List <Hashtable> contactList = new List <Hashtable>();

            foreach (KeyValuePair <uint, Sdk_ContactInfo> item in friendList)
            {
                var       _item      = item.Value;
                Hashtable memberInfo = new Hashtable()
                {
                    { "QQNumber", _item.QQNumber },
                    { "Nick", _item.Nick },
                    { "Gender", _item.Gender },
                    { "Age", _item.Age }
                };
                contactList.Add(memberInfo);
            }

            return(new RetJsonData()
            {
                Data = contactList
            });
        }