post

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyPostDB            = "post.gorm.db"
	KeyPostNoCheckRouter = "post.router.nocheck"
	KeyPostCheckRouter   = "post.router.check"
)

Variables

View Source
var Dao = new(PostDao)

Functions

func BeforeQueryRenderPost

func BeforeQueryRenderPost(ctx *fiber.Ctx, queryResult *object.QueryResult) (any, error)

func BeforeRenderPost

func BeforeRenderPost(ctx *fiber.Ctx, vptr any) (any, error)

func Bind

func Bind(c *fiber.Ctx, post *model.Post) error

func BindCategory

func BindCategory(c *fiber.Ctx, category *model.Category) error

func GetPostOrPageDB

func GetPostOrPageDB(ctx *fiber.Ctx, isCreate bool) *gorm.DB

Types

type PostDao

type PostDao struct{}

func (PostDao) Count

func (pd PostDao) Count() int64

func (PostDao) CountByDraft

func (pd PostDao) CountByDraft() int64

func (PostDao) CountByPublished

func (pd PostDao) CountByPublished() int64

func (PostDao) CountByTrash

func (pd PostDao) CountByTrash() int64

func (PostDao) CountCatgegory

func (pd PostDao) CountCatgegory() int64

func (PostDao) DeleteByIds

func (pd PostDao) DeleteByIds(ids []uint)

func (PostDao) DeleteCategoriesByIds

func (pd PostDao) DeleteCategoriesByIds(ids []uint)

func (PostDao) DeletePermanetlyByIds

func (pd PostDao) DeletePermanetlyByIds(ids []uint)

func (PostDao) GetAllByPage

func (pd PostDao) GetAllByPage(page, numPerPage int) []model.Post

func (PostDao) GetByID

func (pd PostDao) GetByID(id uint) (*model.Post, error)

func (PostDao) GetBySlug

func (pd PostDao) GetBySlug(slug string) (*model.Post, error)

func (PostDao) GetCategories

func (pd PostDao) GetCategories() []model.Category

func (PostDao) GetCategoriesByPage

func (pd PostDao) GetCategoriesByPage(page, numPerPage int) []model.Category

func (PostDao) GetCategoryByID

func (pd PostDao) GetCategoryByID(id uint) (*model.Category, error)

func (PostDao) GetDraftListByPage

func (pd PostDao) GetDraftListByPage(page, numPerPage int, categoryID int, q string) []model.Post

func (PostDao) GetListByPage

func (pd PostDao) GetListByPage(page, numPerPage int, categoryID int, q string) []model.Post

func (PostDao) GetPublishedListByPage

func (pd PostDao) GetPublishedListByPage(page, numPerPage int, categoryID int, q string) []model.Post

func (PostDao) GetTrashListByPage

func (pd PostDao) GetTrashListByPage(page, numPerPage int, categoryID int, q string) []model.Post

func (PostDao) RestoreByIds

func (pd PostDao) RestoreByIds(ids []uint)

func (PostDao) UpdateDraft

func (pd PostDao) UpdateDraft(value uint)

Jump to

Keyboard shortcuts

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