Skip to content

Commit

Permalink
Implment individual item endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Jul 27, 2020
1 parent 7bdaeb1 commit 07e85d5
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,25 @@



class %%RESOURCENAME%%(Resource):
def get(self, %%DECORATOR%%) -> %%RETURN_TYPE%%:
"""%%DOCTSTRING%%"""
return %%SOMETHING%%
class Item(Resource):
def get(self, queue: str, number: int) -> str:
"""Returns the JSON representation of the item requested.
Example:
/api/ce/100 returns:
Args:
queue (str): The queue of the item requested.
item (int): The number of the item requested.
Returns:
str: JSON representation of the item requested.
"""
return ECNQueue.Item(queue, number).toJson()



api.add_resource(%%RESOURCENAME%%, "%%ROUTE%%")
api.add_resource(Item, "/api/<string:queue>/<int:number>")



Expand Down

0 comments on commit 07e85d5

Please sign in to comment.