Call APIs

This commit is contained in:
2024-04-06 17:08:01 +08:00
parent 35b28d1003
commit eaf074609e
7 changed files with 325 additions and 0 deletions

22
pkg/models/calls.go Normal file
View 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"`
}

View File

@ -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"`
}