init
This commit is contained in:
18
models/user.go
Normal file
18
models/user.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID `gorm:"primaryKey" json:"id"`
|
||||
Username string `gorm:"not null" json:"username"`
|
||||
PubKey string `gorm:"type:text;uniqueIndex;not null" json:"pub_key"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
|
||||
Channels []*Channel `gorm:"many2many:channel_users" json:"channels,omitempty"`
|
||||
ChannelLinks []ChannelUser `gorm:"foreignKey:UserID" json:"channel_links,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user