diff --git a/.gitignore b/.gitignore
index 9e26d9a..75569aa 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,21 @@
+# python/cache
**/__pycache__
+**/venv/*
+**/.venv/*
+
+# databases
**/*.db
**/*.sql
**/*.db.back
-**/venv/*
-**/.venv/*
databases/*
+
+# flask folder
mirrors/*
blueprint/kami_views.py
+blueprint/massage_views.py
templates/kami/*
+templates/message/*
static/upload/*
static/counter.txt
static/message/*
-templates/message/*
-blueprint/massage_views.py
+static/test/*
\ No newline at end of file
diff --git a/api/api.py b/api/api.py
new file mode 100644
index 0000000..0319eef
--- /dev/null
+++ b/api/api.py
@@ -0,0 +1,41 @@
+from flask import Blueprint
+import json
+import sqlite3
+
+api_api = Blueprint('/api/', __name__)
+json_title = {'Content-Type': 'application/json'} # 设定json的类型
+
+# 引入数据库
+def get_owp_db_conn():
+ conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/owp.db')
+ conn.row_factory = sqlite3.Row
+ return conn
+
+
+# 获取日志内容
+@api_api.get("/get/logs/")
+def get_logs():
+ # 获取并查询数据库日志内容
+ conn = get_owp_db_conn()
+ sql_logs = "SELECT * FROM logs;"
+ logs = conn.execute(sql_logs).fetchall()
+ conn.close()
+
+ data_logs = [
+ dict(row) for row in logs
+ ]
+ return (json.dumps(data_logs, ensure_ascii=False), json_title)
+
+
+@api_api.get("/get/posts/")
+def get_posts():
+ # 获取并查询数据库日志内容
+ conn = get_owp_db_conn()
+ sql_posts = "SELECT * FROM posts WHERE status=1;"
+ posts = conn.execute(sql_posts).fetchall()
+ conn.close()
+
+ data_posts = [
+ dict(row) for row in posts
+ ]
+ return (json.dumps(data_posts, ensure_ascii=False), json_title)
\ No newline at end of file
diff --git a/api/docs.py b/api/docs.py
new file mode 100644
index 0000000..8ace5d0
--- /dev/null
+++ b/api/docs.py
@@ -0,0 +1,14 @@
+from flask import Blueprint
+
+docs_api = Blueprint('/api/docs', __name__)
+
+@docs_api.get("/")
+def home():
+ return """
+