diff --git a/app/routes/assets.py b/app/routes/assets.py new file mode 100644 index 0000000..e69de29 diff --git a/app/routes/cards.py b/app/routes/cards.py new file mode 100644 index 0000000..802c275 --- /dev/null +++ b/app/routes/cards.py @@ -0,0 +1,8 @@ +from flask import Blueprint +from ..services import cards + +card_bp = Blueprint("card", __name__, "/card") + +@card_bp.route("/") +def search_card(id): + return cards.readCard(id) \ No newline at end of file diff --git a/app/routes/reactions.py b/app/routes/reactions.py new file mode 100644 index 0000000..e69de29 diff --git a/app/services/cards.py b/app/services/cards.py index e69de29..bc5999f 100644 --- a/app/services/cards.py +++ b/app/services/cards.py @@ -0,0 +1,11 @@ +import json + +def readCardList() -> dict: + with open("cards/list.json", "r", encoding="utf8") as f: + text = f.read() + result = json.loads(text) + + return result + +def readCard(id: str): + return readCardList().get(id, -1) \ No newline at end of file diff --git a/app/services/matters.py b/app/services/matters.py index e69de29..0bd4d04 100644 --- a/app/services/matters.py +++ b/app/services/matters.py @@ -0,0 +1,11 @@ +import json + +def readMatterList() -> dict: + with open("matters/list.json", "r", encoding="utf8") as f: + text = f.read() + result = json.loads(text) + + return result + +def readMatter(id: str): + return readMatterList().get(id, -1) \ No newline at end of file diff --git a/app/services/reactions.py b/app/services/reactions.py index e69de29..e99a22c 100644 --- a/app/services/reactions.py +++ b/app/services/reactions.py @@ -0,0 +1,11 @@ +import json + +def readReactionList() -> dict: + with open("reactions/list.json", "r", encoding="utf8") as f: + text = f.read() + result = json.loads(text) + + return result + +def readReaction(id: str): + return readReactionList().get(id, -1) \ No newline at end of file