Files
2026-04-25 16:36:34 +08:00

41 lines
1.1 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 踢人记录模型
* TypeGoose 定义,符合 Tailchat 插件标准模式
*/
import { db } from 'tailchat-server-sdk';
const { getModelForClass, prop, modelOptions, TimeStamps, index } = db;
@modelOptions({ options: { customName: 'p_saleschat_kickrecord' } })
@index({ groupId: 1, kickedAt: -1 })
@index({ userId: 1, kickedAt: -1 })
export class KickRecord extends TimeStamps implements db.Base {
_id: db.Types.ObjectId;
id: string;
/** 群组 ID关联群组 */
@prop({ required: true, ref: 'Group' })
groupId: db.Types.ObjectId;
/** 被踢用户 ID关联用户 */
@prop({ required: true, ref: 'User' })
userId: db.Types.ObjectId;
/** 操作人 ID关联用户 */
@prop({ required: true, ref: 'User' })
kickedBy: db.Types.ObjectId;
/** 原因 */
@prop({ default: '无' })
reason: string;
/** 踢出时间 */
@prop({ default: () => new Date() })
kickedAt: Date;
}
export type KickRecordDocument = db.DocumentType<KickRecord>;
const model = getModelForClass(KickRecord);
export type KickRecordModel = typeof model;
export default model;