entity

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Follow

type Follow struct {
	gorm.Model
	Uuid        *uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	UserID      uint
	User        *User
	Following   *User
	FollowingID uint `gorm:"foreignkey:User"`
}

type Notification

type Notification struct {
	gorm.Model
	Uuid              *uuid.UUID             `gorm:"type:uuid;default:uuid_generate_v4()"`
	Seen              bool                   `gorm:"default:false"`
	Link              string                 `gorm:"not null"`
	NotificationType  model.NotificationType `gorm:"index"`
	UserID            uint                   `gorm:"index"`
	User              *User
	TriggeredByUserID uint `gorm:"index"`
	TriggeredByUser   *User
}

type Post

type Post struct {
	gorm.Model
	Text          string
	Draft         bool
	UserID        uint
	User          *User
	ReplyToPostID uint `gorm:"foreignkey:Post"`
	ReplyToPost   *Post
	Visibility    model.Visibility `gorm:"default:'public'"`
	Uuid          *uuid.UUID       `gorm:"type:uuid;default:uuid_generate_v4()"`
}

func (*Post) UpdatePostFromModel

func (p *Post) UpdatePostFromModel(post *model.Post)

func (*Post) UpdateReplyFromModel added in v0.1.3

func (p *Post) UpdateReplyFromModel(reply *model.Reply)

type User

type User struct {
	gorm.Model
	Uuid       *uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"`
	Username   string     `gorm:"unique;not null"`
	ProfilePic string
	Name       string
	Role       string `gorm:"default:'user'"`
	IsBanned   bool   `gorm:"default:false"`
}

func (*User) UpdateUserProfileFromModel

func (u *User) UpdateUserProfileFromModel(user *model.User)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL