잉여개발기 (SPDV) пре 2 година
родитељ
комит
37a5c1b2d0
39 измењених фајлова са 107 додато и 35 уклоњено
  1. 2 1
      app.py
  2. 2 0
      route/__init__.py
  3. 1 1
      route/go_api_bbs.py
  4. 1 1
      route/go_api_bbs_list.py
  5. 9 0
      route/go_api_bbs_set.py
  6. 1 1
      route/go_api_bbs_w_comment.py
  7. 1 1
      route/go_api_func_auth_list.py
  8. 1 1
      route/go_api_func_ip.py
  9. 1 1
      route/go_api_func_ip_menu.py
  10. 1 1
      route/go_api_func_language.py
  11. 1 1
      route/go_api_func_llm.py
  12. 1 1
      route/go_api_func_sha224.py
  13. 1 1
      route/go_api_list_old_page.py
  14. 1 1
      route/go_api_list_recent_block.py
  15. 1 1
      route/go_api_list_recent_change.py
  16. 1 1
      route/go_api_list_recent_discuss.py
  17. 1 1
      route/go_api_list_recent_edit_request.py
  18. 1 1
      route/go_api_list_title_index.py
  19. 1 1
      route/go_api_search.py
  20. 2 2
      route/go_api_setting.py
  21. 1 1
      route/go_api_topic.py
  22. 1 1
      route/go_api_topic_list.py
  23. 2 2
      route/go_api_user_setting_editor.py
  24. 1 1
      route/go_api_w_random.py
  25. 1 1
      route/go_api_w_raw.py
  26. 1 1
      route/go_api_w_render.py
  27. 1 1
      route/go_api_w_set_reset.py
  28. 1 1
      route/go_api_w_watch_list.py
  29. 1 1
      route/go_api_w_xref.py
  30. 13 0
      route/n_bbs_set.py
  31. BIN
      route_go/bin/main.amd64.bin
  32. BIN
      route_go/bin/main.amd64.exe
  33. BIN
      route_go/bin/main.arm64.bin
  34. BIN
      route_go/bin/main.arm64.exe
  35. 4 4
      route_go/main.go
  36. 16 0
      route_go/route/api_bbs_set_update.go
  37. 1 1
      route_go/route/api_setting_edit.go
  38. 1 1
      route_go/route/api_user_setting_editor_insert.go
  39. 31 0
      views/main_css/js/route/bbs_set.js

+ 2 - 1
app.py

@@ -662,7 +662,7 @@ app.route('/vote/add', methods = ['POST', 'GET'])(vote_add)
 # Func-bbs
 app.route('/bbs/main')(bbs_main)
 app.route('/bbs/make', methods = ['POST', 'GET'])(bbs_make)
-# app.route('/bbs/main/set')
+app.route('/bbs/set')(bbs_set)
 app.route('/bbs/in/<int:bbs_num>')(bbs_in)
 app.route('/bbs/in/<int:bbs_num>/<int:page>')(bbs_in)
 # app.route('/bbs/blind/<int:bbs_num>', methods = ['POST', 'GET'])(bbs_hide)
@@ -750,6 +750,7 @@ app.route('/api/v2/topic/<int:num>/<set_type>/<everything:name>')(api_topic_list
 
 app.route('/api/v2/bbs')(api_bbs_list)
 app.route('/api/v2/bbs/main')(api_bbs)
+app.route('/api/v2/bbs/set', methods = ['PUT'])(api_bbs_set)
 app.route('/api/v2/bbs/in/<int:bbs_num>/<int:page>')(api_bbs)
 app.route('/api/v2/bbs/w/comment/<int:bbs_num>/<int:post_num>/<tool>')(api_bbs_w_comment_n)
 

+ 2 - 0
route/__init__.py

@@ -168,6 +168,7 @@ from route.n_list_old_page import list_old_page
 from route.n_list_user_check_submit import list_user_check_submit
 
 from route.n_bbs_in import bbs_in
+from route.n_bbs_set import bbs_set
 
 from route.n_w_watch_list import w_watch_list
 
@@ -196,6 +197,7 @@ from route.go_api_list_old_page import api_list_old_page
 from route.go_api_list_title_index import api_list_title_index
 
 from route.go_api_bbs import api_bbs
+from route.go_api_bbs_set import api_bbs_set
 from route.go_api_bbs_list import api_bbs_list
 from route.go_api_bbs_w_comment import api_bbs_w_comment_n
 

+ 1 - 1
route/go_api_bbs.py

@@ -6,4 +6,4 @@ async def api_bbs(bbs_num = "", page = 1):
     other_set["page"] = str(page)
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_bbs_list.py

@@ -1,4 +1,4 @@
 from .tool.func import *
 
 async def api_bbs_list():
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name)), status = 200, mimetype = 'application/json')

+ 9 - 0
route/go_api_bbs_set.py

@@ -0,0 +1,9 @@
+from .tool.func import *
+
+async def api_bbs_set():
+    other_set = {}
+
+    func_name = sys._getframe().f_code.co_name
+    func_name += '_put'
+
+    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_bbs_w_comment.py

@@ -6,4 +6,4 @@ async def api_bbs_w_comment_n(bbs_num = "", post_num = "", tool = "length"):
     other_set["post_num"] = str(post_num)
     other_set["tool"] = tool
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_func_auth_list.py

@@ -4,4 +4,4 @@ async def api_func_auth_list(user_name = ''):
     other_set = {}
     other_set["ip"] = ip_check() if user_name == '' else user_name
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_func_ip.py

@@ -5,4 +5,4 @@ async def api_func_ip(data = 'Test'):
     other_set["data"] = data
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_func_ip_menu.py

@@ -6,4 +6,4 @@ async def api_func_ip_menu(ip = "Test", option = ""):
     other_set["my_ip"] = ip_check()
     other_set["option"] = option
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_func_language.py

@@ -8,4 +8,4 @@ async def api_func_language(data = 'Test'):
     else:
         other_set["data"] = [data]
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_func_llm.py

@@ -6,6 +6,6 @@ async def api_func_llm():
         other_set["prompt"] = flask.request.form.get('prompt', '')
         other_set["ip"] = ip_check()
 
-        return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+        return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
     else:
         return flask.jsonify({})

+ 1 - 1
route/go_api_func_sha224.py

@@ -4,4 +4,4 @@ async def api_func_sha224(data = 'Test'):
     other_set = {}
     other_set["data"] = data
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_list_old_page.py

@@ -5,4 +5,4 @@ async def api_list_old_page(num = 1, set_type = 'old'):
     other_set["num"] = str(num)
     other_set["set_type"] = set_type
     
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_list_recent_block.py

@@ -7,4 +7,4 @@ async def api_list_recent_block(num = 1, set_type = 'all', user_name = 'Test'):
     other_set["user_name"] = user_name
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_list_recent_change.py

@@ -8,7 +8,7 @@ async def api_list_recent_change(num = 1, set_type = 'normal', limit = 10, legac
     other_set["legacy"] = legacy
     other_set["ip"] = ip_check()
 
-    response = flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    response = flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
     
     response.headers.add("Access-Control-Allow-Origin", "*")
     response.headers.add('Access-Control-Allow-Headers', "Content-Type")

+ 1 - 1
route/go_api_list_recent_discuss.py

@@ -8,7 +8,7 @@ async def api_list_recent_discuss(num = 1, set_type = 'normal', limit = 10, lega
     other_set["legacy"] = legacy
     other_set["ip"] = ip_check()
 
-    response = flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    response = flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
     
     response.headers.add("Access-Control-Allow-Origin", "*")
     response.headers.add('Access-Control-Allow-Headers', "Content-Type")

+ 1 - 1
route/go_api_list_recent_edit_request.py

@@ -7,4 +7,4 @@ async def api_list_recent_edit_request(num = 1, set_type = 'normal', limit = 50)
     other_set["set_type"] = set_type
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_list_title_index.py

@@ -4,4 +4,4 @@ async def api_list_title_index(num = 1):
     other_set = {}
     other_set["num"] = str(num)
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_search.py

@@ -6,4 +6,4 @@ async def api_search(name = 'Test', search_type = 'title', num = 1):
     other_set["search_type"] = search_type
     other_set["num"] = str(num)
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 2 - 2
route/go_api_setting.py

@@ -7,7 +7,7 @@ async def api_setting(name = 'Test'):
 
     func_name = sys._getframe().f_code.co_name
     if flask.request.method == 'PUT':
-        func_name += '_edit'
+        func_name += '_put'
         other_set['data'] = flask.request.form.get('data', 'Test')
     
-    return flask.Response(response = await python_to_golang(func_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_topic.py

@@ -132,6 +132,6 @@ async def api_topic(topic_num = 1, tool = 'normal', s_num = '', e_num = ''):
             other_set["e_num"] = str(e_num)
             other_set["ip"] = ip_check()
 
-            return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+            return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
         else:
             return flask.jsonify({})

+ 1 - 1
route/go_api_topic_list.py

@@ -6,4 +6,4 @@ async def api_topic_list(name = 'Test', set_type = 'normal', num = 1):
     other_set["set_type"] = set_type
     other_set["num"] = str(num)
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 2 - 2
route/go_api_user_setting_editor.py

@@ -6,10 +6,10 @@ async def api_user_setting_editor():
     
     func_name = sys._getframe().f_code.co_name
     if flask.request.method == 'POST':
-        func_name += '_insert'
+        func_name += '_post'
         other_set['data'] = flask.request.form.get('data', 'Test')
     elif flask.request.method == 'DELETE':
         func_name += '_delete'
         other_set['data'] = flask.request.form.get('data', 'Test')
 
-    return flask.Response(response = await python_to_golang(func_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(func_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_w_random.py

@@ -1,4 +1,4 @@
 from .tool.func import *
 
 async def api_w_random():
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_w_raw.py

@@ -8,6 +8,6 @@ async def api_w_raw(name = 'Test', rev = '', exist_check = ''):
             other_set["rev"] = str(rev)
             other_set["exist_check"] = exist_check
 
-            return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+            return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
         else:
             return flask.jsonify({})

+ 1 - 1
route/go_api_w_render.py

@@ -88,6 +88,6 @@ async def api_w_render(name = '', tool = ''):
                 other_set["render_type"] = data_type
                 other_set["data"] = data_org
 
-                return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+                return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')
         else:
             return flask.jsonify({})

+ 1 - 1
route/go_api_w_set_reset.py

@@ -5,4 +5,4 @@ async def api_w_set_reset(name = 'Test'):
     other_set["name"] = name
     other_set["ip"] = ip_check()
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_w_watch_list.py

@@ -7,4 +7,4 @@ async def api_w_watch_list(name = 'Test', do_type = 'watch_list', num = 1):
     other_set["ip"] = ip_check()
     other_set["num"] = str(num)
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 1 - 1
route/go_api_w_xref.py

@@ -6,4 +6,4 @@ async def api_w_xref(name = 'Test', page = 1, xref_type = '1'):
     other_set["page"] = str(page)
     other_set["do_type"] = xref_type
 
-    return flask.Response(response = await python_to_golang(sys._getframe().f_code.co_name, other_set), status = 200, mimetype = 'application/json')
+    return flask.Response(response = (await python_to_golang(sys._getframe().f_code.co_name, other_set)), status = 200, mimetype = 'application/json')

+ 13 - 0
route/n_bbs_set.py

@@ -0,0 +1,13 @@
+from .tool.func import *
+
+def bbs_set():
+    with get_db_connect() as conn:
+        return easy_minify(conn, flask.render_template(skin_check(conn),
+            imp = [get_lang(conn, 'bbs_set'), wiki_set(conn), wiki_custom(conn), wiki_css([0, 0])],
+            data = '' + \
+                '<div id="opennamu_bbs_set"></div>' + \
+                '<script defer src="/views/main_css/js/route/bbs_set.js' + cache_v() + '"></script>' + \
+                '<script>window.addEventListener("DOMContentLoaded", function() { opennamu_bbs_set(); });</script>' + \
+            '',
+            menu = [['bbs/main', get_lang(conn, 'bbs_main')]]
+        ))

BIN
route_go/bin/main.amd64.bin


BIN
route_go/bin/main.amd64.exe


BIN
route_go/bin/main.arm64.bin


BIN
route_go/bin/main.arm64.exe


+ 4 - 4
route_go/main.go

@@ -65,16 +65,16 @@ func main() {
 		route_data = route.Api_list_recent_block(call_arg[1:])
 	} else if call_arg[0] == "api_list_title_index" {
 		route_data = route.Api_list_title_index(call_arg[1:])
-	} else if call_arg[0] == "api_user_setting_editor_insert" {
-		route_data = route.Api_user_setting_editor_insert(call_arg[1:])
+	} else if call_arg[0] == "api_user_setting_editor_post" {
+		route_data = route.Api_user_setting_editor_post(call_arg[1:])
 	} else if call_arg[0] == "api_user_setting_editor_delete" {
 		route_data = route.Api_user_setting_editor_delete(call_arg[1:])
 	} else if call_arg[0] == "api_user_setting_editor" {
 		route_data = route.Api_user_setting_editor(call_arg[1:])
 	} else if call_arg[0] == "api_setting" {
 		route_data = route.Api_setting(call_arg[1:])
-	} else if call_arg[0] == "api_setting_edit" {
-		route_data = route.Api_setting_edit(call_arg[1:])
+	} else if call_arg[0] == "api_setting_put" {
+		route_data = route.Api_setting_put(call_arg[1:])
 	} else if call_arg[0] == "api_func_ip_menu" {
 		route_data = route.Api_func_ip_menu(call_arg[1:])
 	} else {

+ 16 - 0
route_go/route/api_bbs_set_update.go

@@ -0,0 +1,16 @@
+package route
+
+import (
+	"encoding/json"
+	"opennamu/route/tool"
+)
+
+func Api_bbs_set_update(call_arg []string) string {
+	other_set := map[string]string{}
+	json.Unmarshal([]byte(call_arg[0]), &other_set)
+
+	db := tool.DB_connect()
+	defer db.Close()
+
+	return ""
+}

+ 1 - 1
route_go/route/api_setting_edit.go

@@ -6,7 +6,7 @@ import (
 	"opennamu/route/tool"
 )
 
-func Api_setting_edit(call_arg []string) string {
+func Api_setting_put(call_arg []string) string {
 	other_set := map[string]string{}
 	json.Unmarshal([]byte(call_arg[0]), &other_set)
 

+ 1 - 1
route_go/route/api_user_setting_editor_insert.go

@@ -6,7 +6,7 @@ import (
 	"opennamu/route/tool"
 )
 
-func Api_user_setting_editor_insert(call_arg []string) string {
+func Api_user_setting_editor_post(call_arg []string) string {
 	other_set := map[string]string{}
 	json.Unmarshal([]byte(call_arg[0]), &other_set)
 

+ 31 - 0
views/main_css/js/route/bbs_set.js

@@ -0,0 +1,31 @@
+function opennamu_bbs_set_post() {
+    let post_data = new FormData();
+    post_data.append('data', '');
+
+    fetch('/api/v2/bbs/set', {
+        method : 'put',
+        body : post_data,
+    }).then(function(res) {
+        return res.json();
+    }).then(function(data) {
+
+    });
+}
+
+function opennamu_bbs_set() {
+    let lang_data = new FormData();
+    lang_data.append('data', 'title_start_document title_end_document title_include_document move document_name');
+
+    fetch('/api/lang', {
+        method : 'post',
+        body : lang_data,
+    }).then(function(res) {
+        return res.json();
+    }).then(function(lang) {
+        lang = lang["data"];
+    
+        document.getElementById('opennamu_bbs_set').innerHTML = '' +
+            '<button onclick="opennamu_bbs_set_post();"></button>' +
+        '';
+    });
+}