Skip to content

Commit

Permalink
fix(route/xiaohongshu) add method annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
dddaniel1 committed Oct 22, 2024
1 parent 785ab3f commit 1170b00
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/routes/xiaohongshu/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ async function handler(ctx) {
}
}

/**
* 获取所有笔记
* @param notes 用户笔记信息
* @param urlPrex 笔记详情前缀
*/
async function renderNotesFulltext(notes, urlPrex) {
const data = [];
const promises = notes.flatMap((note) =>
Expand All @@ -86,6 +91,10 @@ async function renderNotesFulltext(notes, urlPrex) {
return data;
}

/**
* 获取笔记全文
* @param link
*/
async function getFullNote(link) {
const cookie = config.xiaohongshu.cookie;
const data = (await cache.tryGet(link, async () => {
Expand Down Expand Up @@ -122,6 +131,12 @@ async function getFullNote(link) {
})) as Promise<{ title: string; description: string; pubDate: Date }>;
return data;
}

/**
* 获取用户信息和笔记列表信息
* @param url
* @param cookie
*/
async function getUser(url: string, cookie: string) {
const res = await got(url, {
headers: {
Expand Down

0 comments on commit 1170b00

Please sign in to comment.