categoryModel

package
v0.0.0-...-352c0ba Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPostToCategory

func AddPostToCategory(categoryId int32, postId int32) (bool, int32)

AddPostToCategory func

func Insert

func Insert(newCategory *Category) (success bool, categoryId int32)

Insert func

func RemovePostFromCategory

func RemovePostFromCategory(categoryId int32, postId int32) (bool, int32)

RemovePostFromCategory func

Types

type Category

type Category struct {
	ID        int32  `db:"id"`
	Title     string `db:"title"`
	Slug      string `db:"slug"`
	Content   string `db:"content"`
	CreatedAt int32  `db:"created_at"`
	UpdatedAt int32  `db:"updated_at"`
}

func Delete

func Delete(categoryId int32) (bool, *Category)

Delete func

func Update

func Update(newCategory *Category) (bool, *Category)

Update func

type PostCategory

type PostCategory struct {
	PostId     int32 `db:"post_id"`
	CategoryId int32 `db:"category_id"`
}

Jump to

Keyboard shortcuts

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