Prechádzať zdrojové kódy

BBS 기능 일부 이전

잉여개발기 4 mesiacov pred
rodič
commit
98a9ef86dd

+ 2 - 1
app.py

@@ -848,7 +848,8 @@ app.route('/bbs/in/<int:bbs_num>/<int:page>')(golang_view())
 app.route('/bbs/delete/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_delete)
 app.route('/bbs/set/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_w_set)
 app.route('/bbs/edit/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_w_edit)
-app.route('/bbs/w/<int:bbs_num>/<int:post_num>', methods = ['POST', 'GET'])(bbs_w_post)
+app.route('/bbs/w/<int:bbs_num>/<int:post_num>', methods = ['POST'])(bbs_w_post)
+app.route('/bbs/w/<int:bbs_num>/<int:post_num>', methods = ['GET'])(golang_view())
 # app.route('/bbs/blind/<int:bbs_num>/<int:post_num>', methods = ['POST', 'GET'])(bbs_w_hide)
 app.route('/bbs/pinned/<int:bbs_num>/<int:post_num>', methods = ['POST', 'GET'])(bbs_w_pinned)
 app.route('/bbs/delete/<int:bbs_num>/<int:post_num>', methods = ['POST', 'GET'])(bbs_w_delete)

+ 6 - 2
route/go_api_bbs_w.py

@@ -2,10 +2,14 @@ from .tool.func import *
 
 async def api_bbs_w(sub_code = '', legacy = 'on'):
     other_set = {}
-    other_set["legacy"] = legacy
     other_set['sub_code'] = sub_code
 
-    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+    data = await python_to_golang(sys._getframe().f_code.co_name, other_set)
+
+    if legacy == "on":
+        return data["data"]
+    else:
+        return data
 
 async def api_bbs_w_exter(sub_code = '', legacy = 'on'):
     return flask.jsonify(await api_bbs_w(sub_code, legacy))

+ 5 - 2
route/go_api_bbs_w_comment.py

@@ -4,9 +4,12 @@ async def api_bbs_w_comment(sub_code = '', tool = "", legacy = 'on'):
     other_set = {}
     other_set["sub_code"] = sub_code
     other_set["tool"] = tool
-    other_set["legacy"] = legacy
 
-    return await python_to_golang(sys._getframe().f_code.co_name, other_set)
+    data = await python_to_golang(sys._getframe().f_code.co_name, other_set)
+    if legacy == "on":
+        return data["data"]
+    else:
+        return data
 
 async def api_bbs_w_comment_exter(sub_code = '', tool = "", legacy = 'on'):
     return flask.jsonify(await api_bbs_w_comment(sub_code, tool, legacy))

+ 1 - 1
views/main_css/js/route/bbs_w_post.js

@@ -55,7 +55,7 @@ function opennamu_load_comment() {
     }).then(function(lang) {
         lang = lang["data"];
 
-        fetch('/api/v2/bbs/w/comment/' + bbs_id + '-' + bbs_code + '/normal').then(function(res) {
+        fetch('/api/v2/bbs/w/comment/' + bbs_id + '-' + bbs_code + '/around').then(function(res) {
             return res.json();
         }).then(function(data) {
             let data_html = '';