diff --git a/API文档.md b/API文档.md index 27c7e78..a831d07 100644 --- a/API文档.md +++ b/API文档.md @@ -150,6 +150,8 @@ "content": "文章内容", "created_at": "2024-05-10T12:00:00+00:00", "updated_at": "2024-05-10T12:00:00+00:00", + "upvotes": 114, + "downvotes": 514, "status": "Pass" } ] @@ -173,6 +175,7 @@ #### 12. 提交投诉 - **URL**: `POST /report` - **请求参数(JSON)**: + ```json { "id": 123, diff --git a/api_server.py b/api_server.py index f92a1b7..63a2916 100644 --- a/api_server.py +++ b/api_server.py @@ -449,6 +449,8 @@ def get_10_info(): "content": s.content, "created_at": s.created_at.isoformat(), "updated_at": s.updated_at.isoformat(), + "upvotes": s.upvotes, + "downvotes": s.downvotes, "status": s.status } for s in page_posts]), 200 @@ -817,4 +819,4 @@ if __name__ == '__main__': with app.app_context(): initialize_database() NEED_AUDIT = get_config("need_audit", "false").lower() == "true" - app.run(host='0.0.0.0', port=5000, debug=True) + app.run(host='0.0.0.0', port=5000)