52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import PocketBase, { RecordModel } from "pocketbase"
|
|
import { Logger } from "winston"
|
|
|
|
import PbToolBase from "../base"
|
|
|
|
/** GroupSummaryLog 集合名称 */
|
|
const DB_NAME = "grpSumLog"
|
|
|
|
/**
|
|
* 群组摘要日志接口
|
|
* 定义了群组摘要记录的数据结构
|
|
*/
|
|
export interface GroupSummaryLog {
|
|
/** 关联的聊天 ID */
|
|
chat: string
|
|
/** 摘要内容 */
|
|
content: string
|
|
/** Langfuse 链接引用 */
|
|
langfuseLink: string
|
|
}
|
|
|
|
/**
|
|
* 群组摘要日志模型类型
|
|
* 结合了 GroupSummaryLog 接口和 RecordModel 基础类型
|
|
*/
|
|
export type GroupSummaryLogModel = GroupSummaryLog & RecordModel
|
|
|
|
/**
|
|
* 群组摘要日志数据库操作类
|
|
* 提供对群组摘要日志集合的 CRUD 操作
|
|
*
|
|
* @extends PbToolBase<GroupSummaryLogModel>
|
|
*/
|
|
class GroupSummaryLogDB extends PbToolBase<GroupSummaryLogModel> {
|
|
/**
|
|
* 创建群组摘要日志数据库操作实例
|
|
*
|
|
* @param pbClient - PocketBase 客户端实例
|
|
* @param logger - 日志记录器实例
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* const summaryLogDB = new GroupSummaryLogDB(pbClient, logger);
|
|
* ```
|
|
*/
|
|
constructor(pbClient: PocketBase, logger: Logger) {
|
|
super(DB_NAME, pbClient, logger)
|
|
}
|
|
}
|
|
|
|
export default GroupSummaryLogDB
|