mirror of https://github.com/msgbyte/tailchat
feat: 增加服务端与agora后台的数据通信处理
parent
f444fb5143
commit
f9e53d205e
@ -0,0 +1,55 @@
|
||||
import { db } from 'tailchat-server-sdk';
|
||||
const { getModelForClass, prop, modelOptions, TimeStamps } = db;
|
||||
|
||||
@modelOptions({
|
||||
options: {
|
||||
customName: 'p_agora_meeting',
|
||||
},
|
||||
})
|
||||
export class AgoraMeeting extends TimeStamps implements db.Base {
|
||||
_id: db.Types.ObjectId;
|
||||
id: string;
|
||||
|
||||
@prop()
|
||||
converseId: string;
|
||||
|
||||
@prop()
|
||||
channelName: string;
|
||||
|
||||
@prop()
|
||||
active: boolean;
|
||||
|
||||
/**
|
||||
* 参会人
|
||||
*/
|
||||
@prop({
|
||||
default: [],
|
||||
})
|
||||
members: string[];
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@prop()
|
||||
endAt?: Date;
|
||||
|
||||
static async findLastestMeetingByConverseId(
|
||||
this: db.ReturnModelType<typeof AgoraMeeting>,
|
||||
converseId: string
|
||||
) {
|
||||
return this.findOne({
|
||||
converseId,
|
||||
active: true,
|
||||
}).sort({
|
||||
_id: -1,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export type AgoraMeetingDocument = db.DocumentType<AgoraMeeting>;
|
||||
|
||||
const model = getModelForClass(AgoraMeeting);
|
||||
|
||||
export type AgoraMeetingModel = typeof model;
|
||||
|
||||
export default model;
|
@ -1,20 +0,0 @@
|
||||
import { db } from 'tailchat-server-sdk';
|
||||
const { getModelForClass, prop, modelOptions, TimeStamps } = db;
|
||||
|
||||
@modelOptions({
|
||||
options: {
|
||||
customName: 'p_agora',
|
||||
},
|
||||
})
|
||||
export class Agora extends TimeStamps implements db.Base {
|
||||
_id: db.Types.ObjectId;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export type AgoraDocument = db.DocumentType<Agora>;
|
||||
|
||||
const model = getModelForClass(Agora);
|
||||
|
||||
export type AgoraModel = typeof model;
|
||||
|
||||
export default model;
|
Loading…
Reference in New Issue