blog

package
v0.0.0-...-1d3a159 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	bun.BaseModel `bun:"articles,alias:a"`

	ID          uint64 `json:"-"`
	Slug        string `json:"slug"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Body        string `json:"body"`

	Author   *org.Profile `json:"author" bun:"rel:belongs-to"`
	AuthorID uint64       `json:"-"`

	Tags    []ArticleTag `json:"-" bun:"rel:has-many"`
	TagList []string     `json:"tagList" bun:",scanonly,array"`

	Favorited      bool `json:"favorited" bun:",scanonly"`
	FavoritesCount int  `json:"favoritesCount" bun:",scanonly"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

func SelectArticle

func SelectArticle(ctx context.Context, app *bunapp.App, slug string) (*Article, error)

type ArticleFilter

type ArticleFilter struct {
	UserID    uint64
	Author    string
	Tag       string
	Favorited string
	Slug      string
	Feed      bool
	urlstruct.Pager
	// contains filtered or unexported fields
}

type ArticleHandler

type ArticleHandler struct {
	// contains filtered or unexported fields
}

func NewArticleHandler

func NewArticleHandler(app *bunapp.App) ArticleHandler

func (ArticleHandler) Create

func (ArticleHandler) Delete

func (ArticleHandler) Favorite

func (ArticleHandler) Feed

func (ArticleHandler) List

func (ArticleHandler) Show

func (ArticleHandler) Unfavorite

func (ArticleHandler) Update

type ArticleTag

type ArticleTag struct {
	bun.BaseModel `bun:"alias:t"`

	ArticleID uint64
	Tag       string
}

type Comment

type Comment struct {
	bun.BaseModel `bun:"comments,alias:c"`

	ID   uint64 `json:"id"`
	Body string `json:"body"`

	Author   *org.Profile `json:"author" bun:"rel:belongs-to"`
	AuthorID uint64       `json:"-"`

	ArticleID uint64 `json:"-"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type CommentHandler

type CommentHandler struct {
	// contains filtered or unexported fields
}

func NewCommentHandler

func NewCommentHandler(app *bunapp.App) CommentHandler

func (CommentHandler) Create

func (CommentHandler) Delete

func (CommentHandler) List

func (CommentHandler) Show

type FavoriteArticle

type FavoriteArticle struct {
	bun.BaseModel `bun:"alias:fa"`

	UserID    uint64
	ArticleID uint64
}

type TagHandler

type TagHandler struct {
	// contains filtered or unexported fields
}

func NewTagHandler

func NewTagHandler(app *bunapp.App) TagHandler

func (TagHandler) List

Jump to

Keyboard shortcuts

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