mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
612 B
TypeScript
37 lines
612 B
TypeScript
import {
|
|
getModelForClass,
|
|
prop,
|
|
DocumentType,
|
|
Ref,
|
|
} from '@typegoose/typegoose';
|
|
import type { Base } from '@typegoose/typegoose/lib/defaultClasses';
|
|
import type { Types } from 'mongoose';
|
|
import { User } from './user';
|
|
|
|
/**
|
|
* 好友请求
|
|
*/
|
|
|
|
export class FriendRequest implements Base {
|
|
_id: Types.ObjectId;
|
|
id: string;
|
|
|
|
@prop({
|
|
ref: () => User,
|
|
index: true,
|
|
})
|
|
from: Ref<User>;
|
|
|
|
@prop({
|
|
ref: () => User,
|
|
})
|
|
to: Ref<User>;
|
|
|
|
@prop()
|
|
message: string;
|
|
}
|
|
|
|
export type FriendRequestDocument = DocumentType<FriendRequest>;
|
|
|
|
export default getModelForClass(FriendRequest);
|