public async Task QueryBookmarkTest() { UserContentProvider mine = new UserContentProvider(); LoginResult result = await mine.Login(Config.username, Config.password); List<BookmarkResult> nr = await mine.QueryBookmark(0, result.Id.ToString(), result.MobileToken); Assert.IsNotNull(nr); }
private async Task QueryNote(string type) { UserContentProvider user = new UserContentProvider(); if(type == "喜欢") { if(likePage == 0) { DisplayCollection = new ObservableCollection<NoteItem>(); likeList = new List<NoteItem>(); } List<Note> temp = await user.QueryLikeNotes(likePage, GlobalValue.CurrentUserContext.UserId, GlobalValue.CurrentUserContext.MobileToken); temp.ForEach(x => { var v = ConvertToNoteItem(x); likeList.Add(v); DisplayCollection.Add(v); }); likePage++; } else { if(markPage == 0) { DisplayCollection = new ObservableCollection<NoteItem>(); markList = new List<NoteItem>(); } List<BookmarkResult> temp = await user.QueryBookmark(markPage, GlobalValue.CurrentUserContext.UserId, GlobalValue.CurrentUserContext.MobileToken); temp.ForEach(x => { var v = ConvertToNoteItem(x.Note); markList.Add(v); DisplayCollection.Add(v); }); } }