整理项目结构

Change-Id: I14b059f2c462100581d2acfef6efbee130bed861
diff --git a/TRM/back/app/functions/Fpost.py b/TRM/back/app/functions/Fpost.py
new file mode 100644
index 0000000..5651e8b
--- /dev/null
+++ b/TRM/back/app/functions/Fpost.py
@@ -0,0 +1,31 @@
+from ..models.users import User as users
+from ..models.post import Post as post
+
+from sqlalchemy.orm import Session
+class Fpost:
+    def __init__(self,session:Session):
+        self.session=session
+        return
+    
+
+    def getlist(self):
+        results = self.session.query(post.id, post.title,post.status)
+        return results
+    def getpost(self,postid):
+        res=self.session.query(post).filter(post.id==postid).first()
+        return res
+    def checkid(self,userid):
+        res=self.session.query(users).filter(users.id==userid).first()
+        if(not res):
+            return False
+        if res.role !='superadmin':
+            return False
+        return True
+    
+    def review(self,postid,status):
+        res=self.session.query(post).filter(post.id==postid).first()
+        if not res:
+            return False
+        res.status=status
+        self.session.commit()
+        return True
\ No newline at end of file
diff --git a/TRM/back/app/functions/__pycache__/Fpost.cpython-310.pyc b/TRM/back/app/functions/__pycache__/Fpost.cpython-310.pyc
new file mode 100644
index 0000000..fe0c6de
--- /dev/null
+++ b/TRM/back/app/functions/__pycache__/Fpost.cpython-310.pyc
Binary files differ