forum

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2017 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID        uint      `orm:"column(id)" json:"id"`
	Title     string    `json:"title"`
	Body      string    `json:"body"`
	Type      string    `json:"type"`
	UpdatedAt time.Time `orm:"auto_now" json:"updatedAt"`
	CreatedAt time.Time `orm:"auto_now_add" json:"createdAt"`

	User     *nut.User  `orm:"rel(fk)" json:"user"`
	Tags     []*Tag     `orm:"rel(m2m);column(tag_id);rel_table(forum_articles_tags)" json:"tags"`
	Comments []*Comment `orm:"reverse(many)" json:"comments"`
}

Article article

func (*Article) TableName

func (*Article) TableName() string

TableName table name

type Comment

type Comment struct {
	ID        uint      `orm:"column(id)" json:"id"`
	Body      string    `json:"body"`
	Type      string    `json:"type"`
	UpdatedAt time.Time `orm:"auto_now" json:"updatedAt"`
	CreatedAt time.Time `orm:"auto_now_add" json:"createdAt"`

	User    *nut.User `orm:"rel(fk)" json:"user"`
	Article *Article  `orm:"rel(fk)" json:"article"`
}

Comment comment

func (*Comment) TableName

func (*Comment) TableName() string

TableName table name

type Plugin

type Plugin struct {
	nut.Controller
}

Plugin controller

func (*Plugin) CreateArticle

func (p *Plugin) CreateArticle()

CreateArticle create @router /articles [post]

func (*Plugin) CreateComment

func (p *Plugin) CreateComment()

CreateComment create @router /comments [post]

func (*Plugin) CreateTag

func (p *Plugin) CreateTag()

CreateTag create @router /tags [post]

func (*Plugin) DestroyArticle

func (p *Plugin) DestroyArticle()

DestroyArticle remove @router /articles/:id [delete]

func (*Plugin) DestroyComment

func (p *Plugin) DestroyComment()

DestroyComment remove @router /comments/:id [delete]

func (*Plugin) DestroyTag

func (p *Plugin) DestroyTag()

DestroyTag remove @router /tags/:id [delete]

func (*Plugin) EditArticle

func (p *Plugin) EditArticle()

EditArticle edit @router /articles/edit/:id [get]

func (*Plugin) EditComment

func (p *Plugin) EditComment()

EditComment edit @router /comments/edit/:id [get]

func (*Plugin) EditTag

func (p *Plugin) EditTag()

EditTag edit @router /tags/edit/:id [get]

func (*Plugin) IndexArticles

func (p *Plugin) IndexArticles()

IndexArticles list all cards @router /articles [get]

func (*Plugin) IndexComments

func (p *Plugin) IndexComments()

IndexComments list all cards @router /comments [get]

func (*Plugin) IndexTags

func (p *Plugin) IndexTags()

IndexTags list all cards @router /tags [get]

func (*Plugin) LatestArticles

func (p *Plugin) LatestArticles()

LatestArticles latest @router /latest/articles [get]

func (*Plugin) LatestComments

func (p *Plugin) LatestComments()

LatestComments latest @router /latest/comments [get]

func (*Plugin) LatestTags

func (p *Plugin) LatestTags()

LatestTags latest @router /latest/tags [get]

func (*Plugin) NewArticle

func (p *Plugin) NewArticle()

NewArticle new card @router /articles/new [get]

func (*Plugin) NewComment

func (p *Plugin) NewComment()

NewComment new card @router /comments/new [get]

func (*Plugin) NewTag

func (p *Plugin) NewTag()

NewTag new card @router /tags/new [get]

func (*Plugin) ShowArticle

func (p *Plugin) ShowArticle()

ShowArticle show @router /articles/:id [get]

func (*Plugin) ShowTag

func (p *Plugin) ShowTag()

ShowTag show @router /tags/:id [get]

func (*Plugin) UpdateArticle

func (p *Plugin) UpdateArticle()

UpdateArticle update @router /articles/:id [post]

func (*Plugin) UpdateComment

func (p *Plugin) UpdateComment()

UpdateComment update @router /comments/:id [post]

func (*Plugin) UpdateTag

func (p *Plugin) UpdateTag()

UpdateTag update @router /tags/:id [post]

type Tag

type Tag struct {
	ID        uint      `orm:"column(id)" json:"id"`
	Name      string    `json:"name"`
	UpdatedAt time.Time `orm:"auto_now" json:"updatedAt"`
	CreatedAt time.Time `orm:"auto_now_add" json:"createdAt"`

	Articles []*Article `orm:"reverse(many);rel_table(forum_articles_tags)" json:"articles"`
}

Tag tag

func (*Tag) TableName

func (*Tag) TableName() string

TableName table name

Jump to

Keyboard shortcuts

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