|
@@ -90,9 +90,9 @@ async function findMatchingContentsPage(discipline, content, page) {
|
|
try {
|
|
try {
|
|
// 使用余弦相似度进行内容向量匹配
|
|
// 使用余弦相似度进行内容向量匹配
|
|
const query = `
|
|
const query = `
|
|
- SELECT id, content,
|
|
|
|
|
|
+ SELECT title, id, content, file_url,
|
|
1 - (content_vector <#> $1::vector) AS contentSimilarity
|
|
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
|
|
ORDER BY contentSimilarity DESC
|
|
LIMIT 5 OFFSET $3;
|
|
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) => {
|
|
router.route("/selectTypeTrainCourse2").all((req, res, next) => {
|
|
var json = queryString(req.url);
|
|
var json = queryString(req.url);
|
|
getmysql(
|
|
getmysql(
|
|
@@ -3793,7 +3816,27 @@ router.route("/selectTypeCourse2Mode").all((req, res, next) => {
|
|
json["org"]
|
|
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) => {
|
|
router.route("/selectTypeTrainCourse2Mode").all((req, res, next) => {
|
|
var json = queryString(req.url);
|
|
var json = queryString(req.url);
|