chengjie 2 月之前
父节点
当前提交
c3c96f0bc7
共有 2 个文件被更改,包括 6 次插入15 次删除
  1. 2 0
      src/api/miaoguo/literacyController.js
  2. 4 15
      src/test/build.test41.js

+ 2 - 0
src/api/miaoguo/literacyController.js

@@ -70,6 +70,8 @@ export async function GetMiaoguoAISearch(ctx) {
70 70
                         obj.Type="shici";
71 71
                         obj.Key=param.Word;
72 72
                         obj.TypeName="诗词";
73
+                        obj.Remark=literacyItem[i].Author;
74
+                        obj.Content="";
73 75
                     }
74 76
                     result.List.push(obj);
75 77
                 }

+ 4 - 15
src/test/build.test41.js

@@ -7,8 +7,7 @@ import aiController from '../api/yjbdc/aiController.js';
7 7
 async function runScript(){
8 8
     try {
9 9
         
10
-        //按照高频单词的使用频率排序,列出所有单词
11
-        const sql="select * from MiaoguoLiteracy where ID<=114758 order by ID desc;";
10
+        const sql="SELECT * FROM kylx365_db.MiaoguoLiteracy where SearchType='shici' and JSONString like '%Paraphrase\":[\"%' order by ID desc;";
12 11
         
13 12
         let list = await commonModel.RunSql(null,sql);
14 13
         let count=list.length;
@@ -24,21 +23,11 @@ async function runScript(){
24 23
                 json=JSON.parse(item.JSONString);
25 24
                 
26 25
                 if (json.ENG){
27
-                    if (json.ENG.Paraphrase && !stringUtils.IsArray(json.ENG.Paraphrase)){
28
-                        json.ENG.Paraphrase=[json.ENG.Paraphrase];
29
-                        //console.log(json.ENG.Paraphras);
30
-                        b=true;
26
+                    json.ENG=null;
27
+                    //console.log(json.ENG.Paraphras);
28
+                    b=true;
31 29
 
32
-                        if (json.ENG.Paraphrase[0].PartOfSpeech=="")
33
-                            json.ENG.Paraphrase[0].PartOfSpeech="释义";
34 30
                         
35
-
36
-                        if (json.ENG.Paraphrase[0].ParaphraseList && !stringUtils.IsArray(json.ENG.Paraphrase[0].ParaphraseList)){
37
-                            json.ENG.Paraphrase[0].ParaphraseList=[json.ENG.Paraphrase[0].ParaphraseList];
38
-                            //console.log(json.ENG.Paraphrase[0].ParaphraseList);
39
-                            b=true;
40
-                        }
41
-                    }
42 31
                     
43 32
                 }
44 33
             }