models

package
v0.0.0-...-4ebaa52 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateModels

func MigrateModels(db *gorm.DB)

Types

type Board

type Board struct {
	gorm.Model
	Title string `json:"title"`
	Link  string `json:"link"`
	UUID  string `json:"uuid"`
	Posts []Post
}

type Comment

type Comment struct {
	gorm.Model
	UUID          string `json:"uuid"`
	CreatedBy     string `json:"created_by"`
	PostID        uint
	Content       string `json:"content"`
	FileExtension string `json:"file_extension"`
}

func GetPostComments

func GetPostComments(id string) ([]Comment, error)

type Post

type Post struct {
	gorm.Model
	UUID          string `json:"uuid"`
	CreatedBy     string `json:"created_by"`
	BoardID       uint
	Comments      []Comment `json:"comments"`
	Content       string    `json:"content"`
	FileExtension string    `json:"file_extension"`
}

func (*Post) GetComments

func (post *Post) GetComments() ([]Comment, error)

Jump to

Keyboard shortcuts

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