Examples of DoubanSubjectObj


Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

  private DoubanReviewEntryObj generateReviewObj (long subjectId, String content, int rating, String title, Long reviewUrl) {
    DoubanReviewEntryObj obj = new DoubanReviewEntryObj();
    if (reviewUrl != null) {
      obj.setId(RequestUrls.DOUBAN_REVIEW_PREFIX + "/" + reviewUrl);
    }
    DoubanSubjectObj sub = new DoubanSubjectObj();
    sub.setId("" + subjectId);
    obj.setSubject(sub);
    if (content != null && content.length() > 0) {
      obj.setContent(content);
    } else {
      obj.setContent("");
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

 
  public static void testGetBookInfo () {
    try {
      long bookId = 2023013;
      DoubanBookMovieMusicService service = new DoubanBookMovieMusicService();
      DoubanSubjectObj book = service.getMusicInfoById(2272292);
      System.out.println("title : " + book.getTitle());
      for (DoubanTagObj tag : book.getTags()) {
        System.out.println("tag, count : " + tag.getCount() + " , name : " + tag.getName());
      }
      System.out.println("rating, min : " + book.getRating().getMin() + ", max : " + book.getRating().getMax() + " , value : " + book.getRating().getValue() + " , count : " + book.getRating().getNumberOfRaters() + " , avg : " + book.getRating().getAverage());
      System.out.println("author : " + book.getAuthors().get(0).getName());
      for (DoubanAttributeObj att : book.getAttributes()) {
        System.out.println("att, name : " + att.getName() + " , value : " + att.getValue());
      }
      System.out.println("summary : " + book.getSummary());
    } catch (DoubanException ex) {
      Logger.getLogger(PlayGround.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
      Logger.getLogger(PlayGround.class.getName()).log(Level.SEVERE, null, ex);
    }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

      col.setTags(tagsList);
    }
    if (subjectId == null) {
      return null;
    }
    DoubanSubjectObj sub = new DoubanSubjectObj();
    sub.setId("" + subjectId);
    col.setSubject(sub);
    col.setContent(content == null ? "" : content);
    if (isPrivate != null && isPrivate) {
      List<DoubanAttributeObj> atts = new ArrayList<DoubanAttributeObj>();
      DoubanAttributeObj att = new DoubanAttributeObj();
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

    super();
  }
 
  public DoubanSubjectObj getBookInfoById (long bookId) throws DoubanException, IOException {
    String url = RequestUrls.DOUBAN_BOOK_SUBJECT_PREFIX + "/" + bookId;
    DoubanSubjectObj book = this.client.getResponse(url, null, DoubanSubjectObj.class, false);
    return book;
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

   */
  public void testGetBookInfoById() throws Exception {
    System.out.println("getBookInfoById");
    long bookId = 10440147L;
    DoubanBookMovieMusicService instance = new DoubanBookMovieMusicService();
    DoubanSubjectObj result = instance.getBookInfoById(bookId);
    assertEquals(result.getTitle(), "世间的名字");
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

   */
  public void testGetBookInfoByISBN() throws Exception {
    System.out.println("getBookInfoByISBN");
    String isbn = "9787208104815";
    DoubanBookMovieMusicService instance = new DoubanBookMovieMusicService();
    DoubanSubjectObj result = instance.getBookInfoByISBN(isbn);
    assertEquals(result.getTitle(), "世间的名字");
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

   */
  public void testGetMovieInfoById() throws Exception {
    System.out.println("getMovieInfoById");
    long movieId = 6041191L;
    DoubanBookMovieMusicService instance = new DoubanBookMovieMusicService();
    DoubanSubjectObj result = instance.getMovieInfoById(movieId);
    System.out.println("title : " + result.getTitle());
    assertEquals(result.getTitle(), "听风者");
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

   */
  public void testGetMovieInfoByIMDBId() throws Exception {
    System.out.println("getMovieInfoByIMDBId");
    String imdbId = "tt2078768";
    DoubanBookMovieMusicService instance = new DoubanBookMovieMusicService();
    DoubanSubjectObj result = instance.getMovieInfoByIMDBId(imdbId);
    System.out.println("title : " + result.getTitle());
    assertEquals(result.getTitle(), "听风者");
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

   */
  public void testGetMusicInfoById() throws Exception {
    System.out.println("getMusicInfoById");
    long musicId = 4753298L;
    DoubanBookMovieMusicService instance = new DoubanBookMovieMusicService();
    DoubanSubjectObj result = instance.getMusicInfoById(musicId);
    System.out.println("title : " + result.getTitle());
    assertEquals(result.getTitle(), "艺术男儿裆自强");
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.subject.DoubanSubjectObj

    return book;
  }
 
  public DoubanSubjectObj getBookInfoByISBN (String isbn) throws DoubanException, IOException {
    String url = RequestUrls.DOUBAN_BOOK_SUBJECT_PREFIX + "/isbn/" + isbn;
    DoubanSubjectObj book = this.client.getResponse(url, null, DoubanSubjectObj.class, false);
    return book;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.