Преглед на файлове

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl-api

SanHQin преди 4 месеца
родител
ревизия
3551fe5de4
променени са 1 файла, в които са добавени 46 реда и са изтрити 3 реда
  1. 46 3
      pbl.js

+ 46 - 3
pbl.js

@@ -90,9 +90,9 @@ async function findMatchingContentsPage(discipline, content, page) {
     try {
         // 使用余弦相似度进行内容向量匹配
         const query = `
-            SELECT id, content,
+            SELECT title, id, content, file_url,
                    1 - (content_vector <#> $1::vector) AS contentSimilarity
-            FROM (select id, content, content_vector from knowledgefiles as a where top_dir_id in (select id from directory_files where $2 = '' or folder_name = ANY(string_to_array($2, ',')))) as a
+            FROM (select file_url, title, id, content, content_vector from knowledgefiles as a where top_dir_id in (select id from directory_files where $2 = '' or folder_name = ANY(string_to_array($2, ',')))) as a
             ORDER BY contentSimilarity DESC
             LIMIT 5 OFFSET $3;
         `;
@@ -3752,6 +3752,29 @@ router.route("/selectTypeCourse2").all((req, res, next) => {
     );
 });
 //根据分类查询所有课程
+router.route("/selectTypeCourse22").all((req, res, next) => {
+    var json = queryString(req.url);
+    getmysql(
+        req,
+        res,
+        "selectTypeCourse22",
+        json["uid"],
+        json["oid"],
+        json["typea"],
+        json["typeb"],
+        json["typec"],
+        json["typed"],
+        json["typeE"],
+        json["cu"],
+        json["cn"],
+        json["classid"],
+        json["org"],
+        json["page"],
+        json["pageSize"],
+        json["orderBy"]
+    );
+});
+//根据分类查询所有课程
 router.route("/selectTypeTrainCourse2").all((req, res, next) => {
     var json = queryString(req.url);
     getmysql(
@@ -3793,7 +3816,27 @@ router.route("/selectTypeCourse2Mode").all((req, res, next) => {
         json["org"]
     );
 });
-
+//根据分类查询所有课程
+router.route("/selectTypeCourse2Mode2").all((req, res, next) => {
+    var json = queryString(req.url);
+    getmysql(
+        req,
+        res,
+        "selectTypeCourse2Mode2",
+        json["uid"],
+        json["oid"],
+        json["typea"],
+        json["typeb"],
+        json["typec"],
+        json["typed"],
+        json["typeE"],
+        json["cu"],
+        json["cn"],
+        json["classid"],
+        json["org"],
+        json["orderBy"]
+    );
+});
 //根据分类查询所有课程
 router.route("/selectTypeTrainCourse2Mode").all((req, res, next) => {
     var json = queryString(req.url);