|
|
@@ -477,11 +477,13 @@ export async function GetEnglishAll3(ctx) {
|
|
477
|
477
|
UpdateTime: ctx.query.UpdateTime,
|
|
478
|
478
|
};
|
|
479
|
479
|
|
|
|
480
|
+ const functionName = "GetEnglishAll3";
|
|
|
481
|
+
|
|
480
|
482
|
const updateTimeList = await commonModel.GetDataUpdateStatus();
|
|
481
|
483
|
const updateTime = moment(updateTimeList[6].UpdateTime).format('YYYY.MM.DD HH:mm:ss');
|
|
482
|
484
|
|
|
483
|
485
|
if (param.UpdateTime !== updateTime) {
|
|
484
|
|
- let result = globalCache.get("GetEnglishAll3");
|
|
|
486
|
+ let result = globalCache.get(functionName);
|
|
485
|
487
|
if (result === 0) {
|
|
486
|
488
|
result = {
|
|
487
|
489
|
UpdateTime: updateTime,
|
|
|
@@ -492,7 +494,7 @@ export async function GetEnglishAll3(ctx) {
|
|
492
|
494
|
Limit: 3000
|
|
493
|
495
|
};
|
|
494
|
496
|
const engList = await commonModel.RunSql({}, "SELECT * FROM WordFrequency LIMIT 3000");
|
|
495
|
|
- const arrEng = [{
|
|
|
497
|
+ let arrEng = [{
|
|
496
|
498
|
ID:111,
|
|
497
|
499
|
Name:"高频单词1",
|
|
498
|
500
|
Name2:"Sight Words",
|
|
|
@@ -562,7 +564,7 @@ export async function GetEnglishAll3(ctx) {
|
|
562
|
564
|
}
|
|
563
|
565
|
}
|
|
564
|
566
|
|
|
565
|
|
- const result2 = JSON.stringify(arrEng);
|
|
|
567
|
+ let result2 = JSON.stringify(arrEng);
|
|
566
|
568
|
arrEng = Encrypt(result2, config.urlSecrets.aes_key, config.urlSecrets.aes_iv);
|
|
567
|
569
|
result.EngList = arrEng;
|
|
568
|
570
|
|
|
|
@@ -847,8 +849,7 @@ export async function GetEnglishAll3(ctx) {
|
|
847
|
849
|
Max:556,
|
|
848
|
850
|
Units:[],
|
|
849
|
851
|
}];
|
|
850
|
|
-
|
|
851
|
|
- const engList2 = await commonModel.GetWordsList();
|
|
|
852
|
+ const engList2 = await phonics.GetWordsList();
|
|
852
|
853
|
const enumList = await commonModel.GetEnumerationListByParentID({ParentID:"320,346,375"});
|
|
853
|
854
|
let unit = 0;
|
|
854
|
855
|
for (let i = 0; i < engList2.length; i++) {
|
|
|
@@ -879,12 +880,6 @@ export async function GetEnglishAll3(ctx) {
|
|
879
|
880
|
arrEng2[j].Units.push(temp);
|
|
880
|
881
|
}
|
|
881
|
882
|
|
|
882
|
|
- // console.log("i:"+i);
|
|
883
|
|
- // console.log("j:"+j);
|
|
884
|
|
- //
|
|
885
|
|
- // if (i==27415 && j==35)
|
|
886
|
|
- // debugger;
|
|
887
|
|
-
|
|
888
|
883
|
arrEng2[j].Units[arrEng2[j].Units.length-1].Words.push(engList2[i].Word);
|
|
889
|
884
|
unit = engList2[i].LessonID;
|
|
890
|
885
|
break;
|
|
|
@@ -892,7 +887,6 @@ export async function GetEnglishAll3(ctx) {
|
|
892
|
887
|
}
|
|
893
|
888
|
}
|
|
894
|
889
|
|
|
895
|
|
-
|
|
896
|
890
|
result.NewConceptEngList = [arrEng2[0], arrEng2[1], arrEng2[2], arrEng2[3]];
|
|
897
|
891
|
const result3 = JSON.stringify(result.NewConceptEngList);
|
|
898
|
892
|
result.NewConceptEngList = Encrypt(result3, config.urlSecrets.aes_key, config.urlSecrets.aes_iv);
|
|
|
@@ -933,7 +927,7 @@ export async function GetEnglishAll3(ctx) {
|
|
933
|
927
|
const result12 = JSON.stringify(result.CET6EngList);
|
|
934
|
928
|
result.CET6EngList = Encrypt(result12, config.urlSecrets.aes_key, config.urlSecrets.aes_iv);
|
|
935
|
929
|
|
|
936
|
|
- globalCache.set("GetEnglishAll3", result, config.BufferMemoryTimeHigh);
|
|
|
930
|
+ globalCache.set(functionName, result, config.BufferMemoryTimeHigh);
|
|
937
|
931
|
console.log("缓存");
|
|
938
|
932
|
}
|
|
939
|
933
|
|
|
|
@@ -942,4 +936,4 @@ export async function GetEnglishAll3(ctx) {
|
|
942
|
936
|
else {
|
|
943
|
937
|
ctx.body = {"errcode": 10000};
|
|
944
|
938
|
}
|
|
945
|
|
-}
|
|
|
939
|
+}
|