Beispiel #1
0
 def get(self, id):
     book = _repository.get_by_id(id)
     if book is not None:
         return send_from_directory(book.file.path,
                                    book.file.file_name,
                                    as_attachment=True)
     else:
         return not_found()
Beispiel #2
0
 def get(self, id):
     try:
         Indexer().index_book(id)
         return ok()
     except:
         return not_found()
Beispiel #3
0
 def get(self, id):
     try:
         Indexer().start(id)
         return ok()
     except:
         return not_found()
Beispiel #4
0
 def delete(self, id):
     result = _service.delete_by_id(id)
     return ok(id) if result else not_found()
Beispiel #5
0
 def get(self, id):
     book = _repository.get_by_id(id)
     return book if book else not_found()