잉여개발기 пре 6 месеци
родитељ
комит
743fd10bab

+ 11 - 11
app.py

@@ -648,8 +648,8 @@ app.route('/xref_page/<int:num>/<everything:name>')(view_xref)
 app.route('/xref_this/<everything:name>', defaults = { 'xref_type' : 2 })(view_xref)
 app.route('/xref_this_page/<int:num>/<everything:name>', defaults = { 'xref_type' : 2 })(view_xref)
 
-app.route('/doc_watch_list/<int:num>/<everything:name>')(view_w_watch_list)
-app.route('/doc_star_doc/<int:num>/<everything:name>', defaults = { 'do_type' : 'star_doc' })(view_w_watch_list)
+app.route('/doc_watch_list/<int:num>/<everything:name>')(golang_view())
+app.route('/doc_star_doc/<int:num>/<everything:name>')(golang_view())
 
 app.route('/raw/<everything:name>')(view_w_raw)
 app.route('/raw_acl/<everything:name>', defaults = { 'doc_acl' : 'on' })(view_w_raw)
@@ -667,8 +667,8 @@ app.route('/render/<int:doc_rev>/<everything:name>')(view_w)
 app.route('/w_from/<everything:name>', defaults = { 'do_type' : 'from' })(view_w)
 app.route('/w/<everything:name>')(view_w)
 
-app.route('/random')(view_random)
-app.route('/list/random')(view_list_random)
+app.route('/random')(golang_view())
+app.route('/list/random')(golang_view())
 
 # Func-edit
 app.route('/edit/<everything:name>', methods = ['POST', 'GET'])(edit)
@@ -744,13 +744,13 @@ app.route('/alarm')(user_alarm)
 app.route('/alarm/delete')(user_alarm_delete)
 app.route('/alarm/delete/<int:id>')(user_alarm_delete)
 
-app.route('/watch_list', defaults = { 'do_type' : 'watch_list' })(view_user_watch_list)
-app.route('/watch_list/<everything:name>', defaults = { 'tool' : 'watch_list' })(user_watch_list_name)
-app.route('/watch_list_from/<everything:name>', defaults = { 'tool' : 'watch_list_from' })(user_watch_list_name)
+app.route('/watch_list')(golang_view())
+app.route('/watch_list/<everything:name>')(golang_view())
+app.route('/watch_list_from/<everything:name>')(golang_view())
 
-app.route('/star_doc', defaults = { 'do_type' : 'star_doc' })(view_user_watch_list)
-app.route('/star_doc/<everything:name>', defaults = { 'tool' : 'star_doc' })(user_watch_list_name)
-app.route('/star_doc_from/<everything:name>', defaults = { 'tool' : 'star_doc_from' })(user_watch_list_name)
+app.route('/star_doc')(golang_view())
+app.route('/star_doc/<everything:name>')(golang_view())
+app.route('/star_doc_from/<everything:name>')(golang_view())
 
 # 개편 보류중 S
 app.route('/change/email', methods = ['POST', 'GET'])(user_setting_email)
@@ -790,7 +790,7 @@ app.route('/vote/list/close/<int:num>', defaults = { 'list_type' : 'close' })(vo
 app.route('/vote/add', methods = ['POST', 'GET'])(vote_add)
 
 # Func-bbs
-app.route('/bbs/main')(bbs_main)
+app.route('/bbs/main')(golang_view())
 app.route('/bbs/make', methods = ['POST', 'GET'])(bbs_make)
 app.route('/bbs/in/<int:bbs_num>')(bbs_in)
 app.route('/bbs/in/<int:bbs_num>/<int:page>')(bbs_in)

+ 1 - 9
route/__init__.py

@@ -47,7 +47,6 @@ from route.list_title_index import list_title_index
 from route.list_user import list_user
 from route.list_user_check import list_user_check
 from route.list_user_check_delete import list_user_check_delete
-from route.go_view_list_history import list_history
 
 from route.login_find import login_find
 from route.login_find_email import login_find_email
@@ -165,7 +164,6 @@ from route.n_topic_list import topic_list
 
 from route.n_give_auth import give_auth
 
-from route.n_bbs_main import bbs_main
 from route.n_bbs_in import bbs_in
 from route.n_bbs_w_set import bbs_w_set
 
@@ -217,10 +215,4 @@ from route.go_api_w_render import api_w_render, api_w_render_exter
 from route.go_api_w_set_reset import api_w_set_reset
 from route.go_api_w_page_view import api_w_page_view
 
-from route.go_main_func_easter_egg import main_func_easter_egg
-
-from route.go_view_list_random import view_list_random
-
-from route.go_view_w_watch_list import view_w_watch_list
-
-from route.go_view_user_watch_list import view_user_watch_list
+from route.go_main_func_easter_egg import main_func_easter_egg

+ 0 - 4
route/go_view_list_history.py

@@ -1,4 +0,0 @@
-from .tool.func import *
-
-async def list_history(tool = 'history', num = 1, set_type = 'normal', doc_name = 'Test'):
-    return await python_to_golang("same", {})

+ 0 - 8
route/go_view_list_random.py

@@ -1,8 +0,0 @@
-from .tool.func import *
-
-async def view_list_random():
-    other_set = {}
-
-    data = await python_to_golang(sys._getframe().f_code.co_name, other_set)
-
-    return data["data"]

+ 0 - 11
route/go_view_user_watch_list.py

@@ -1,11 +0,0 @@
-from .tool.func import *
-
-async def view_user_watch_list(num = 1, do_type = 'watch_list'):
-    other_set = {}
-    other_set['name'] = ip_check()
-    other_set['num'] = str(num)
-    other_set['do_type'] = do_type
-
-    data = await python_to_golang(sys._getframe().f_code.co_name, other_set)
-
-    return data["data"]

+ 0 - 11
route/go_view_w_watch_list.py

@@ -1,11 +0,0 @@
-from .tool.func import *
-
-async def view_w_watch_list(name, num = 1, do_type = 'watch_list'):
-    other_set = {}
-    other_set['name'] = name
-    other_set['num'] = str(num)
-    other_set['do_type'] = do_type
-
-    data = await python_to_golang(sys._getframe().f_code.co_name, other_set)
-
-    return data["data"]

+ 0 - 12
route/n_bbs_main.py

@@ -1,12 +0,0 @@
-from .tool.func import *
-
-async def bbs_main():
-    return easy_minify(flask.render_template(await skin_check(),
-        imp = [await get_lang('bbs_main'), await wiki_set(), await wiki_custom(), wiki_css([0, 0])],
-        data = '' + \
-            '<div id="opennamu_bbs_main"></div>' + \
-            '<script defer src="/views/main_css/js/route/bbs_main.js' + cache_v() + '"></script>' + \
-            '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_bbs_main(); });</script>' + \
-        '',
-        menu = [['other', await get_lang('other_tool')], ['bbs/make', await get_lang('add')]]
-    ))

+ 8 - 12
route/tool/func.py

@@ -154,24 +154,20 @@ async def python_to_golang(func_name, other_set = {}):
 
     port_data = global_some_set_do("setup_golang_port")
 
-    func_to_normal_url = {
-        "view_list_random" : "/list/random",
-    }
-
     # print(func_name, other_set)
 
     if func_name == "same":
         async with aiohttp.ClientSession() as session:
-            async with session.get('http://localhost:' + port_data + flask.request.path, headers = headers) as res:
-                data = await res.text()
+            if flask.request.method == 'POST':
+                async with session.post('http://localhost:' + port_data + flask.request.path, data = json_dumps(other_set), headers = headers) as res:
+                    data = await res.text()
 
-                return data
-    elif func_name in func_to_normal_url:
-        async with aiohttp.ClientSession() as session:
-            async with session.post('http://localhost:' + port_data + func_to_normal_url[func_name], data = json_dumps(other_set), headers = headers) as res:
-                data = await res.text()
+                    return data
+            else:
+                async with session.get('http://localhost:' + port_data + flask.request.path, headers = headers) as res:
+                    data = await res.text()
 
-                return data
+                    return data
     else:
         async with aiohttp.ClientSession() as session:
             async with session.post('http://localhost:' + port_data + '/compatible_api/' + func_name, data = json_dumps(other_set), headers = headers) as res:

+ 3 - 3
version.json

@@ -1,6 +1,6 @@
 {
-    "r_ver" : "v3.6.0-Beta-v29",
-    "c_ver" : "20250507",
+    "r_ver" : "v3.6.0-Beta-v30",
+    "c_ver" : "20250508",
     "s_ver" : "20240426",
-    "bin_link" : "https://github.com/openNAMU/GopenNAMU/releases/download/v2025-12-07-Beta-v3/"
+    "bin_link" : "https://github.com/openNAMU/GopenNAMU/releases/download/v2025-12-07-Beta-v4/"
 }

+ 0 - 93
views/main_css/js/route/bbs_main.js

@@ -1,93 +0,0 @@
-"use strict";
-
-function opennamu_bbs_main() {
-    let lang_data = new FormData();
-    lang_data.append('data', ["data", 'comment_base', 'thread_base', ].join(' '));
-
-    fetch('/api/v2/lang', {
-        method : 'POST',
-        body : lang_data,
-    }).then(function(res) {
-        return res.json();
-    }).then(function(lang) {
-        lang = lang["data"];
-
-        fetch('/api/v2/bbs').then(function(res) {
-            return res.json();
-        }).then(function(bbs_list) {
-            bbs_list = bbs_list["data"];
-
-            fetch('/api/v2/bbs/main').then(function(res) {
-                return res.json();
-            }).then(function(data) {
-                data = data["data"];
-
-                let data_html = '<ul>';
-                let bbs_id_to_name = {};
-
-                for(let key in bbs_list) {
-                    bbs_id_to_name[bbs_list[key][0]] = key;
-
-                    data_html += '<li>';
-
-                    data_html += '<a href="/bbs/in/' + bbs_list[key][0] + '">';
-                    data_html += opennamu_xss_filter(key);
-                    data_html += '</a>';
-
-                    data_html += ' (';
-                    if(bbs_list[key][1] === 'comment') {
-                        data_html += lang['comment_base'];
-                    } else {
-                        data_html += lang['thread_base'];
-                    }
-                    data_html += ')';
-
-                    if(bbs_list[key][2] !== '') {
-                        data_html += ' (' + bbs_list[key][2] + ')';
-                    }
-                    
-                    data_html += '</li>';
-                }
-
-                data_html += '</ul>';
-                data_html += '<hr class="main_hr">';
-
-                for(let for_a = 0; for_a < data.length; for_a++) {
-                    data_html += '<div class="opennamu_recent_change">';
-
-                    data_html += '<a href="/bbs/w/' + data[for_a]['set_id'] + '/' + data[for_a]['set_code'] + '">' + opennamu_xss_filter(data[for_a]['title']) + '</a>';
-
-                    data_html += '<div style="float: right;">';
-
-                    data_html += '<span id="opennamu_bbs_comment_' + String(for_a) + '"></span>';
-
-                    data_html += '<a href="/bbs/in/' + data[for_a]['set_id'] + '">';
-                    data_html += bbs_id_to_name[data[for_a]['set_id']]
-                    data_html += '</a>';
-                    data_html += ' | ';
-
-                    data_html += data[for_a]['user_id_render'] + ' | ';
-                    data_html += data[for_a]['date'];
-
-                    data_html += '</div>'
-                    data_html += '<div style="clear: both;"></div>';
-
-                    data_html += '</div>';
-                    data_html += '<hr class="main_hr">';
-                }
-                
-                document.getElementById('opennamu_bbs_main').innerHTML = data_html;
-
-                for(let for_a = 0; for_a < data.length; for_a++) {
-                    fetch('/api/v2/bbs/w/comment/' + data[for_a]['set_id'] + '-' + data[for_a]['set_code'] + '/length').then(function(res) {
-                        return res.json();
-                    }).then(function(comment_data) {
-                        if(comment_data) {
-                            document.getElementById('opennamu_bbs_comment_' + String(for_a)).innerText = comment_data['data'] + ' | ';
-                        }
-                    });
-                }
-            });
-        });
-    });
-}