feat: 考虑到同样物质多种反应的情况
This commit is contained in:
+17
-1
@@ -10,7 +10,15 @@ def readReactionList() -> dict:
|
||||
|
||||
return result
|
||||
|
||||
def readMatchList() -> dict:
|
||||
with open("resources/reactions/match.json", "r", encoding="utf8") as f:
|
||||
text = f.read()
|
||||
result = json.loads(text)
|
||||
|
||||
return result
|
||||
|
||||
reaction_list = readReactionList()
|
||||
match_list = readMatchList()
|
||||
|
||||
def readReaction(id: str):
|
||||
path = reaction_list.get(id, -1)
|
||||
@@ -20,4 +28,12 @@ def readReaction(id: str):
|
||||
text = f.read()
|
||||
result = json.loads(text)
|
||||
|
||||
return {"message": "OK", "content": result}
|
||||
return {"message": "OK", "content": result}
|
||||
|
||||
|
||||
def selectReaction(id: str):
|
||||
matter_id = match_list.get(id, -1)
|
||||
if (matter_id == -1):
|
||||
return {"message": f"No Matter {id}"}
|
||||
|
||||
return matter_id
|
||||
Reference in New Issue
Block a user