Files
backend/app/services/matters.py
T

18 lines
520 B
Python
Raw Normal View History

2026-01-02 21:47:28 +08:00
import json
def readMatterList() -> dict:
with open("resources/matters/list.json", "r", encoding="utf8") as f:
2026-01-02 21:47:28 +08:00
text = f.read()
result = json.loads(text)
return result
def readMatter(id: str):
path = readMatterList().get(id, -1)
if (path == -1):
return {"message": f"No Matter {id}"}
with open(f"resources/matters/{path}.json", "r", encoding="utf8") as f:
text = f.read()
result = json.loads(text)
return {"message": "OK", "content": result}