forum

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//TypeMarkdown markdown
	TypeMarkdown = "markdown"
	//TypeHTML html
	TypeHTML = "html"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Article added in v0.1.1

type Article struct {
	web.Model

	Title   string `json:"title"`
	Summary string `json:"summary"`
	Body    string `json:"body"`
	Type    string `json:"type"`
	Vote    int    `json:"vote"`

	UserID   uint      `json:"user_id"`
	User     auth.User `json:"user"`
	Tags     []Tag     `json:"tags" gorm:"many2many:forum_articles_tags;"`
	Comments []Comment `json:"comments"`
}

Article article

func (*Article) TableName added in v0.1.1

func (p *Article) TableName() string

TableName table name

type Comment added in v0.1.1

type Comment struct {
	web.Model

	Body string `json:"body"`
	Type string `json:"type"`
	Vote int    `json:"vote"`

	UserID    uint      `json:"user_id"`
	User      auth.User `json:"user"`
	ArticleID uint      `json:"article_id"`
	Article   Article   `json:"article"`
}

Comment comment

func (*Comment) TableName added in v0.1.1

func (p *Comment) TableName() string

TableName table name

type Engine added in v0.2.1

type Engine struct {
	I18n  *web.I18n  `inject:""`
	Cache *web.Cache `inject:""`
	Db    *gorm.DB   `inject:""`
	Jwt   *auth.Jwt  `inject:""`
	Dao   *auth.Dao  `inject:""`
}

Engine forum engine

func (*Engine) Home added in v0.2.1

func (p *Engine) Home() gin.HandlerFunc

Home home

func (*Engine) Init added in v0.2.1

func (p *Engine) Init(*inject.Graph) error

Init init ioc objects

func (*Engine) Mount added in v0.2.1

func (p *Engine) Mount(rt *gin.Engine)

Mount web points

func (*Engine) Shell added in v0.2.1

func (p *Engine) Shell() []cli.Command

Shell command line

func (*Engine) Worker added in v0.2.1

func (p *Engine) Worker()

Worker register worker

type Tag added in v0.1.1

type Tag struct {
	web.Model

	Name string `json:"name"`
	Vote int    `json:"vote"`

	Articles []Article `json:"articles" gorm:"many2many:forum_articles_tags;"`
}

Tag tag

func (*Tag) TableName added in v0.1.1

func (p *Tag) TableName() string

TableName table name

Jump to

Keyboard shortcuts

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