20 lines
512 B
Go
20 lines
512 B
Go
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"`
|
|
}
|