Skip to content

Commit 0df01b2

Browse files
committed
doc: todo update
1 parent 0036d41 commit 0df01b2

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

TO-DO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
2. 难度筛选
1414
3. 通过率
1515
- [ ] 登陆和提交到leetcode
16-
16+
- [ ] 提供一个类似vue-cli-serve的脚手架配置项
1717
- [ ] 国际化
1818
- [ ] 插件制作-WS/VS code
1919
- [ ] fork脚本的编写

common/utils/http/fetch_.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
* @private
77
*/
88
export async function fetch_(url, options) {
9-
return await fetch(url, options).then((res) => res.json())
9+
return await fetch(url, options).then(res => res.json())
1010
}

common/utils/http/graphql.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import path from 'node:path'
21
import { fetch_ } from '#common/utils/http/fetch_.js'
32
import { url_join } from '#common/utils/http/urlJoin.js'
43

common/utils/http/submit.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import path from 'node:path'
21
import { fetch_ } from '#common/utils/http/fetch_.js'
32
import { url_join } from '#common/utils/http/urlJoin.js'
43

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { graphql } from '#common/utils/http/graphql.js'
22
import { getQuestionListHot100Json } from '#resources/headers/questionListHot100Json.js'
33

4-
export const getQuestionListHot100 = async () => {
4+
export async function getQuestionListHot100() {
55
const res = await graphql(getQuestionListHot100Json())
66
const {
7-
data: { studyPlanV2Detail }
7+
data: { studyPlanV2Detail },
88
} = res
99
return studyPlanV2Detail
1010
}

common/utils/question-handler/getHot100QuestionList.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import path from 'node:path'
22
import { createQuestionByTitleSlug } from '../create-check/createUtil.js'
33
import { getQuestionListHot100 } from '#common/utils/question-getter/getQuestionListHot100.js'
4+
45
// 获取题目列表
56
export async function getTitleSlugList() {
67
const res = await getQuestionListHot100()
78
const { planSubGroups } = res
89
return planSubGroups.reduce((acc, cur) => {
9-
acc.push(...cur.questions.map((res) => res.titleSlug))
10+
acc.push(...cur.questions.map(res => res.titleSlug))
1011
return acc
1112
}, [])
1213
}
1314
// 获取创建promise列表
1415
async function getPromiseList() {
1516
const titleSlugList = await getTitleSlugList()
1617
const dir = path.join(process.cwd(), 'hot100')
17-
return titleSlugList.map((titleSlug) =>
18-
createQuestionByTitleSlug(titleSlug, dir)
18+
return titleSlugList.map(titleSlug =>
19+
createQuestionByTitleSlug(titleSlug, dir),
1920
)
2021
}
2122

common/utils/question-handler/getQuestionIdBySlug.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { graphql } from '#common/utils/http/graphql.js'
22

33
const headers = {
4-
'content-type': 'application/json'
4+
'content-type': 'application/json',
55
}
66

77
export async function getQuestionIdBySlug(titleSlug) {
88
const body = {
99
query:
1010
'\n query questionTitle($titleSlug: String!) {\n question(titleSlug: $titleSlug) {\n questionId\n questionFrontendId\n title\n titleSlug\n isPaidOnly\n difficulty\n likes\n dislikes\n categoryTitle\n }\n}\n ',
1111
variables: {
12-
titleSlug
12+
titleSlug,
1313
},
14-
operationName: 'questionTitle'
14+
operationName: 'questionTitle',
1515
}
1616
const initJson = {
1717
headers,
1818
body: JSON.stringify(body),
19-
method: 'POST'
19+
method: 'POST',
2020
}
2121
const res = await graphql(initJson)
2222
const { data: question } = res

resources/headers/questionListHot100Json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export function getQuestionListHot100Json() {
66
return {
77
headers: { 'content-type': 'application/json' },
88
body: '{"query":"\\n query studyPlanPastSolved($slug: String!) {\\n studyPlanV2Detail(planSlug: $slug) {\\n planSubGroups {\\n slug\\n questions {\\n titleSlug\\n status\\n }\\n }\\n }\\n}\\n ","variables":{"slug":"top-100-liked"},"operationName":"studyPlanPastSolved"}',
9-
method: 'POST'
9+
method: 'POST',
1010
}
1111
}

0 commit comments

Comments
 (0)