def search_by_isbn(self, isbn): ''' 根据isbn搜索书籍 :param isbn: isbn ''' url = self.isbn_url.format(isbn) result = HTTP.get(url) self.__fill_single(result)
def search_by_keyword(self, keyword, page=1): ''' 根据关键字搜索书籍 :param keyword: 关键字 :param page: 页码 ''' url = self.keyword_url.format(keyword, current_app.config['PER_PAGE'], (page - 1) * current_app.config['PER_PAGE']) result = HTTP.get(url) self.__file_collection(result)
def search_by_keyword(cls, keyword, page=1): url = cls.keyword_url.format(keyword, current_app.config['PER_PAGE'], cls.calculate_start(page)) result = HTTP.get(url) return result
def search_by_isbn(cls, isbn): url = cls.isbn_url.format(isbn) result = HTTP.get(url) return result
def search_by_keyword(self, keyword, page=1): url = self.keyword_url.format(keyword, current_app.config['PER_PAGE'], self.calculate_start(page)) result = HTTP.get(url) self.__fill_collectio(result)
def search_by_isbn(self, isbn): url = self.isbn_url.format(isbn) result = HTTP.get(url) # dict self.__fill_single(result)
def search_by_isbn(cls, isbn): # format 格式化 url = cls.isbn_url.format(isbn) #获得json格式的文件 result = HTTP.get(url) return result