This commit is contained in:
2025-11-02 01:25:30 +01:00
commit ed18be9fbd
17 changed files with 598 additions and 0 deletions

19
models/channel_user.go Normal file
View File

@@ -0,0 +1,19 @@
package models
import (
"time"
"github.com/google/uuid"
)
type ChannelUser struct {
ChannelID uuid.UUID `gorm:"primaryKey" json:"channel_id"`
UserID uuid.UUID `gorm:"primaryKey" json:"user_id"`
Role string `gorm:"default:'member'" json:"role"`
JoinedAt time.Time `gorm:"autoCreateTime" json:"joined_at"`
// Relations pour navigation (optionnelles)
Channel *Channel `gorm:"foreignKey:ChannelID" json:"channel,omitempty"`
User *User `gorm:"foreignKey:UserID" json:"user,omitempty"`
}