✨ Call APIs
This commit is contained in:
22
pkg/models/calls.go
Normal file
22
pkg/models/calls.go
Normal file
@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type CallProvider = string
|
||||
|
||||
const (
|
||||
CallProviderJitsi = "jitsi"
|
||||
)
|
||||
|
||||
type Call struct {
|
||||
BaseModel
|
||||
|
||||
Provider string `json:"provider"`
|
||||
EndedAt *time.Time `json:"ended_at"`
|
||||
|
||||
ExternalID string `json:"external_id"`
|
||||
FounderID uint `json:"founder_id"`
|
||||
ChannelID uint `json:"channel_id"`
|
||||
Founder ChannelMember `json:"founder"`
|
||||
Channel Channel `json:"channel"`
|
||||
}
|
@ -15,6 +15,7 @@ type Channel struct {
|
||||
Description string `json:"description"`
|
||||
Members []ChannelMember `json:"members"`
|
||||
Messages []Message `json:"messages"`
|
||||
Calls []Call `json:"calls"`
|
||||
Type ChannelType `json:"type"`
|
||||
Account Account `json:"account"`
|
||||
AccountID uint `json:"account_id"`
|
||||
@ -38,5 +39,6 @@ type ChannelMember struct {
|
||||
Account Account `json:"account"`
|
||||
Notify NotifyLevel `json:"notify"`
|
||||
|
||||
Calls []Call `json:"calls" gorm:"foreignKey:FounderID"`
|
||||
Messages []Message `json:"messages" gorm:"foreignKey:SenderID"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user