实现投稿ui
This commit is contained in:
22
back/main.py
22
back/main.py
@@ -293,6 +293,28 @@ def downvote():
|
||||
except Exception as e:
|
||||
return jsonify({"code": 2003, "data": f"点踩失败: {str(e)}"})
|
||||
|
||||
@app.route('/api/test', methods=['GET'])
|
||||
def test_api():
|
||||
return jsonify({"code": 1000, "data": ""})
|
||||
|
||||
@app.route('/api/statics', methods=['GET'])
|
||||
def get_statics():
|
||||
try:
|
||||
post_count = Submission.query.count()
|
||||
comment_count = Comment.query.count()
|
||||
# TODO:目前暂未实现图片上传逻辑,先返回114514!!!
|
||||
image_count = 114514
|
||||
return jsonify({
|
||||
"code": 1000,
|
||||
"data": {
|
||||
"posts": post_count,
|
||||
"comments": comment_count,
|
||||
"images": image_count
|
||||
}
|
||||
})
|
||||
except Exception as e:
|
||||
return jsonify({"code": 2003, "data": str(e)})
|
||||
|
||||
# --- 用户的管理api端点 ---
|
||||
# TODO: 用户管理端点
|
||||
|
||||
|
||||
Reference in New Issue
Block a user