-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f444fb5
commit f9e53d2
Showing
4 changed files
with
177 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters