소스 검색

만들다만 comment API 임시 추가

잉여개발기 (SPDV) 2 년 전
부모
커밋
7592693ffc
1개의 변경된 파일34개의 추가작업 그리고 0개의 파일을 삭제
  1. 34 0
      route_go/route/api_bbs_comment.go

+ 34 - 0
route_go/route/api_bbs_comment.go

@@ -0,0 +1,34 @@
+package route
+
+import (
+	"encoding/json"
+	"log"
+	"opennamu/route/tool"
+)
+
+func Api_bbs_comment(call_arg []string) string {
+	db_set := map[string]string{}
+	json.Unmarshal([]byte(call_arg[0]), &db_set)
+
+	other_set := map[string]string{}
+	json.Unmarshal([]byte(call_arg[1]), &other_set)
+
+	db := tool.DB_connect(db_set)
+	defer db.Close()
+
+	if other_set["tool"] == "length" {
+		stmt, err := db.Prepare(tool.DB_change(db_set, "select set_name, set_data, set_code, set_id from bbs_data where (set_name = 'comment' or set_name = 'comment_date' or set_name = 'comment_user_id') and set_id = ? order by set_code + 0 asc"))
+		if err != nil {
+			log.Fatal(err)
+		}
+		defer stmt.Close()
+
+		rows, err := stmt.Query(other_set["bbs_num"])
+		if err != nil {
+			log.Fatal(err)
+		}
+
+	} else {
+		return ""
+	}
+}