init
This commit is contained in:
19
models/channel_user.go
Normal file
19
models/channel_user.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user