-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add helper functions for each endpoint type for search API #258
- Loading branch information
1 parent
46a1539
commit 1049a5f
Showing
2 changed files
with
55 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,42 @@ | ||
""" | ||
Code to store helper functions to deal with the endpoints, like for DataGateway API | ||
""" | ||
import logging | ||
|
||
from datagateway_api.src.search_api.session_handler import ( | ||
SessionHandler, | ||
client_manager, | ||
) | ||
|
||
|
||
log = logging.getLogger() | ||
|
||
|
||
# TODO - Make filters mandatory, if no filters are in a request an empty list will be | ||
# given to these functions | ||
@client_manager | ||
def get_search(entity_name, filters=None): | ||
# TODO - Remove this debug logging when implementing the endpoints, this is just to | ||
# show the client handling works | ||
log.debug( | ||
"Client: %s, Session ID: %s", | ||
SessionHandler.client, | ||
SessionHandler.client.sessionId, | ||
) | ||
|
||
|
||
@client_manager | ||
def get_with_id(entity_name, id, filters=None): | ||
pass | ||
|
||
|
||
@client_manager | ||
def get_count(entity_name, filters=None): | ||
pass | ||
|
||
|
||
@client_manager | ||
def get_files(entity_name, filters=None): | ||
pass | ||
|
||
|
||
@client_manager | ||
def get_files_count(entity_name, id, filters=None): | ||
pass |