This repository has been archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
room.go
30 lines (26 loc) · 1.61 KB
/
room.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package models
import (
"components/timestamp"
)
// Room 房间
type Room struct {
ID uint `json:"id" gorm:"primary_key"`
UUID string `json:"uuid" gorm:"unique_index;size:24"` // 房间对外的 UUID
Name string `json:"name" gorm:"size:128"` // 自定义房间名称
Private bool `json:"private"` // 是否为私密房间
State string `json:"state"` // 房间状态: active, archived
Owner uint `json:"owner" gorm:"index"` // 管理员
RTC string `json:"-" gorm:"size:128"` // RTC RoomName: 房间名称,保持跟 UUID 一致
RTCToken string `json:"rtc_token" gorm:"-"` // RTC RoomToken
Whiteboard string `json:"whiteboard_id" gorm:"size:128"` // 白板房间 ID
WhiteboardToken string `json:"whiteboard_token" gorm:"-"` // 白板房间 token
CreatedAt timestamp.Timestamp `json:"created_at"`
UpdatedAt timestamp.Timestamp `json:"updated_at"`
DeletedAt *timestamp.Timestamp `json:"deleted_at,omitempty"`
Attendees []Attendee `json:"attendees"` // 参会人员
}
// Attendee 会议出席者
type Attendee struct {
UserID uint `json:"user_id" gorm:"unique_index:room_user"`
RoomID uint `json:"room_id" gorm:"unique_index:room_user"`
}