chengjie 4 months ago
parent
commit
fc009c7465
2 changed files with 10 additions and 12 deletions
  1. 9 11
      src/api/yjbdc/yjbdcController.js
  2. 1 1
      src/model/yjbdc.js

+ 9 - 11
src/api/yjbdc/yjbdcController.js

@@ -236,13 +236,6 @@ export async function GenerateArticle(ctx) {
236
             else if (params.AIVersion=="1.5"){
236
             else if (params.AIVersion=="1.5"){
237
                 aiProvider = 'doubao-kimi-k2-250711';
237
                 aiProvider = 'doubao-kimi-k2-250711';
238
             }
238
             }
239
-
240
-
241
-            // if (aiProvider.indexOf("llama")>=0)
242
-            //     content=content.replace("[补充1]",",如果生成的JSON中有ArticleEnglishCorrected和ArticleChineseCorrected,直接覆盖原有的ArticleEnglish和ArticleChinese,不要再生成。");
243
-            // else
244
-            //     content=content.replace("[补充1]","");
245
-            
246
             
239
             
247
             try {
240
             try {
248
                 //开始时间
241
                 //开始时间
@@ -387,7 +380,6 @@ export async function getMiaoguoTodayAllWords(ctx) {
387
     ctx.body = result;
380
     ctx.body = result;
388
 }
381
 }
389
 
382
 
390
-
391
 //获得文章列表或具体文章
383
 //获得文章列表或具体文章
392
 export async function GetYJBDCArticleList(ctx) {
384
 export async function GetYJBDCArticleList(ctx) {
393
     const param = {
385
     const param = {
@@ -396,6 +388,8 @@ export async function GetYJBDCArticleList(ctx) {
396
         IsChoiceness:ctx.query.IsChoiceness || 0,//是否是精选文章
388
         IsChoiceness:ctx.query.IsChoiceness || 0,//是否是精选文章
397
         IsTodayCount: ctx.query.IsTodayCount || false,
389
         IsTodayCount: ctx.query.IsTodayCount || false,
398
         IsNew: ctx.query.IsNew || 0,
390
         IsNew: ctx.query.IsNew || 0,
391
+        PageID: ctx.query.PageID || 999999,
392
+        PageCount: ctx.query.PageCount || 5,
399
     };
393
     };
400
     // 尝试从缓存获取
394
     // 尝试从缓存获取
401
     const url='GetYJBDCArticleList?IsChoiceness='+param.IsChoiceness+'&UserID='+param.UserID+'&ID='+param.ID;
395
     const url='GetYJBDCArticleList?IsChoiceness='+param.IsChoiceness+'&UserID='+param.UserID+'&ID='+param.ID;
@@ -443,10 +437,14 @@ export async function GetYJBDCArticleList(ctx) {
443
         };
437
         };
444
     }
438
     }
445
     else if (!param.ID){
439
     else if (!param.ID){
446
-        let arr=[];
440
+        let arr=[],count=0;
447
         for(let i=0;i<result.length;i++){
441
         for(let i=0;i<result.length;i++){
448
-            if (result[i].Flag==0)
449
-                arr.push(result[i]);
442
+            if (result[i].Flag==0){
443
+                if (param.PageID>result[i].ID && count<param.PageCount){
444
+                    arr.push(result[i]);
445
+                    count++;
446
+                }
447
+            }
450
         }
448
         }
451
         result=arr;
449
         result=arr;
452
     }
450
     }

+ 1 - 1
src/model/yjbdc.js

@@ -120,7 +120,7 @@ class YJBDC {
120
                 return await query(sql, null);
120
                 return await query(sql, null);
121
             }
121
             }
122
             else{
122
             else{
123
-                let sql = "SELECT `ID`,`UserID`,`CreateTime`,`Words`,`Level`,`ArticleStyle`,`ArticleStart`,`ReadCount`,`Flag` FROM YJBDC_Articles WHERE UserID=? order by ID desc limit 100;";
123
+                let sql = "SELECT `ID`,`UserID`,`CreateTime`,`Words`,`Level`,`ArticleStyle`,`ArticleStart`,`ReadCount`,`Flag` FROM YJBDC_Articles WHERE UserID=? order by ID desc;";
124
                 return await query(sql, [obj.UserID]);
124
                 return await query(sql, [obj.UserID]);
125
             }
125
             }
126
         } catch (error) {
126
         } catch (error) {