Skip to content

Commit

Permalink
Developing (#6)
Browse files Browse the repository at this point in the history
* Added entities.

* Improved entities.

* Connected to Java and Middleman completely.
  • Loading branch information
DiegoFHG authored May 2, 2020
1 parent 8a72176 commit 5e128b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions file_indexer_api/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
if __name__ == '__main__':
app.run()


12 changes: 10 additions & 2 deletions file_indexer_api/controllers/search_controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
from flask_restful import Resource, reqparse
from rpyc import connect

parser = reqparse.RequestParser()
parser.add_argument('query')

class SearchController(Resource):
def get(self):
return {'message': 'SearchController'}
def post(self):
args = parser.parse_args()
connection = connect('localhost', 18861, config={"allow_all_attrs": True})
result = connection.root.search(args['query'])

return {'data': result}
2 changes: 1 addition & 1 deletion file_indexer_api/entities/indexer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from file_indexer_api.common.connection_handler_factory import ConnectionHandlerFactory

class Indexer():
class Indexer:
def __init__(self):
self.indexer = ConnectionHandlerFactory.create_connection_handler('indexer')

Expand Down

0 comments on commit 5e128b9

Please sign in to comment.