blog

package
v0.0.0-...-f270e70 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PublishOptionField = "CASE publish_option WHEN 1 THEN \"" + model.PublishOptionPublic.String() + "\" WHEN 2 THEN \"" + model.PublishOptionPassword.String() + "\" ELSE \"" + model.PublishOptionPrivate.String() + "\" END AS publsh_option"

Functions

This section is empty.

Types

type BlogRepository

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

func NewBlogRepository

func NewBlogRepository(db *sql.DB) *BlogRepository

func (*BlogRepository) BeginTransaction

func (r *BlogRepository) BeginTransaction() (*sql.Tx, error)

func (*BlogRepository) CountBlogs

func (r *BlogRepository) CountBlogs(userId int) (*int, error)

func (*BlogRepository) Create

func (r *BlogRepository) Create(now time.Time, input model.CreateBlogInput, userId int) (*model.Blog, error)

func (*BlogRepository) DeleteById

func (r *BlogRepository) DeleteById(tx *sql.Tx, blogId string, userId int) error

func (*BlogRepository) DeleteByUserId

func (r *BlogRepository) DeleteByUserId(tx *sql.Tx, userId int) error

func (*BlogRepository) FindByBlogKey

func (r *BlogRepository) FindByBlogKey(blogKey string, opts *model.BlogByKeyOpts, passwordInputTime *time.Time) (*model.Blog, error)

func (*BlogRepository) FindById

func (r *BlogRepository) FindById(blogId string, userId int) (*model.Blog, error)

func (*BlogRepository) FindByUserId

func (r *BlogRepository) FindByUserId(userId int) ([]*model.Blog, error)

func (*BlogRepository) IsAuthor

func (r *BlogRepository) IsAuthor(blogKey string, userId int) (bool, error)

func (*BlogRepository) Update

func (r *BlogRepository) Update(now time.Time, input model.UpdateBlogInput, userId int) (*model.Blog, error)

Jump to

Keyboard shortcuts

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