23 lines
618 B
Python
23 lines
618 B
Python
from __future__ import annotations
|
|
from flask_restful import Resource
|
|
from flask import current_app as app
|
|
from typing import TYPE_CHECKING
|
|
|
|
if TYPE_CHECKING:
|
|
from modules.Archive.database import Database
|
|
|
|
class GetPost(Resource):
|
|
def get(self, id):
|
|
id = int(id)
|
|
db : Database = app.databases["Archive"]
|
|
|
|
result = db.get_post(id)
|
|
return db.wrap_query_response(result)
|
|
|
|
class GetPostOld(Resource):
|
|
def get(self, id):
|
|
id = int(id)
|
|
db : Database = app.databases["ArchiveOld"]
|
|
|
|
result = db.get_post(id)
|
|
return db.wrap_query_response(result) |