()
| 222 | return await BookmarkHostCheckController.getUserCheckHostsTask(await getAuthedUserId()) |
| 223 | }, |
| 224 | async random() { |
| 225 | const list = await db.query.userBookmarks.findMany({ |
| 226 | with: { relatedTagIds: true }, |
| 227 | orderBy: sql`RANDOM()`, |
| 228 | limit: DEFAULT_BOOKMARK_PAGESIZE, |
| 229 | where: eq(userBookmarks.userId, await getAuthedUserId()), |
| 230 | }) |
| 231 | return { |
| 232 | list: list.map((item) => ({ |
| 233 | ...item, |
| 234 | relatedTagIds: item.relatedTagIds.map((el) => el.tId), |
| 235 | })), |
| 236 | } |
| 237 | }, |
| 238 | /** 获取所有书签数量 */ |
| 239 | async total() { |
| 240 | const userId = await getAuthedUserId() |
nothing calls this directly
no test coverage detected