fix: 修正聊天ID和用户ID的属性名称,修复数据库用户信息获取逻辑

This commit is contained in:
zhaoyingbo 2024-12-19 07:24:48 +00:00
parent 33f6e5f00d
commit 8c42f639ba
2 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ const genReport = async (
})
} catch (error: any) {
logger.error(
`Failed to summarize chat ${subscription.chat_id}: ${error.message}`
`Failed to summarize chat ${subscription.chatId}: ${error.message}`
)
}
}

View File

@ -34,7 +34,7 @@ const create = async (user: User) =>
*/
const getByUserId = async (userId: string) =>
managePbError<UserModel>(() =>
pbClient.collection("user").getFirstListItem(`user_id = "${userId}"`)
pbClient.collection("user").getFirstListItem(`userId = "${userId}"`)
)
/**
@ -49,7 +49,7 @@ const getByCtx = async ({ larkBody, larkService }: Context) => {
if (user) return user
// 如果数据库中没有用户信息从larkService获取用户信息
const userInfo = await larkService.user.getOne(larkBody.userId, "user_id")
if (userInfo.code !== 0) return null
if (userInfo.code === 0) return null
// 解构用户信息
const {
user_id,