File tree 3 files changed +20
-19
lines changed
3 files changed +20
-19
lines changed Original file line number Diff line number Diff line change 1
1
import { getQuestionKeywordJson } from '#resources/headers/questionKeywordJson.js'
2
2
import { graphql } from '#common/utils/http/graphql.js'
3
3
4
- export async function getQuestionKeyword ( keyword ) {
4
+ export async function getQuestionByKeyword ( keyword ) {
5
5
const questionData = await graphql ( getQuestionKeywordJson ( keyword . toString ( ) ) )
6
6
return questionData ?. data ?. problemsetQuestionList ?. questions
7
7
}
8
-
9
- console . log ( getQuestionKeyword ( '两数' ) )
Original file line number Diff line number Diff line change 1
1
import inquirer from 'inquirer'
2
- import { getQuestionKeyword } from '#common/utils/question-getter/getQuestionByKeyword'
2
+ import { getQuestionByKeyword } from '#common/utils/question-getter/getQuestionByKeyword.js '
3
3
4
4
export async function easyFinderView ( ) {
5
5
const modeQuestion = [ {
@@ -17,14 +17,28 @@ export async function easyFinderView() {
17
17
18
18
switch ( mode ) {
19
19
case '关键词搜索' :
20
- const { identity} = getQuestionKeyword ( await inquirer . prompt ( questionKeyword , null ) )
21
- console . log ( identity )
20
+ const data = await getQuestionByKeyword ( await inquirer . prompt ( questionKeyword , null ) )
21
+ const questionList = [ {
22
+ type : 'list' ,
23
+ name : 'chooseQuestion' ,
24
+ message : '请选择题目' ,
25
+ choices : [ ]
26
+ } ]
27
+ let list = [ ]
28
+ console . log ( data )
29
+ // data.map(q => list.push(q.titleCn))
30
+ // questionList[0].choices = list.join(',')
31
+ // console.log(list)
32
+ // const { chooseQuestion } = await inquirer.prompt(questionList, null)
33
+ // console.log(chooseQuestion)
22
34
break
23
35
case 'Top 100列表查询' :
24
36
break
25
37
case '进入筛选模式' :
26
38
break
27
39
}
40
+
41
+ process . exit ( 0 )
28
42
}
29
43
30
44
await easyFinderView ( )
You can’t perform that action at this time.
0 commit comments