From 7f7f8bcf06febd850fbd341674ffadf53e080a18 Mon Sep 17 00:00:00 2001 From: YaoJunchang Date: Thu, 9 Apr 2026 14:41:41 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20bookmark=5Fuid=20handling=20i?= =?UTF-8?q?n=20markRequest=20and=20update=20createMark=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/domain/mark.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/domain/mark.ts b/src/domain/mark.ts index 5efa813..9af7531 100644 --- a/src/domain/mark.ts +++ b/src/domain/mark.ts @@ -35,6 +35,7 @@ export interface markRequest { parent_id: number comment?: string bm_id?: number + bookmark_uid?: string share_code?: string collection_code?: string cb_id?: number @@ -140,7 +141,13 @@ export class MarkService { let userId = 0 const bookmarkHandle = async () => { - bmId = ctx.hashIds.decodeId(data.bm_id || 0) + if (data.bm_id) { + bmId = ctx.hashIds.decodeId(data.bm_id || 0) + } else if (data.bookmark_uid) { + const bm = await this.bookmarkRepo.getUserBookmarkByUId(data.bookmark_uid, ctx.getUserId()) + bm && (bmId = bm.bookmark_id) + } + if (bmId < 1) throw BookmarkNotFoundError() userId = ctx.getUserId() }