postModel

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Insert

func Insert(newPost *Post) (success bool, postId int32)

Insert func

func UpVote

func UpVote(upVoterId int32, postId int32) (success bool, newUpVotes int32)

UpVote func

Types

type Category

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

type Post

type Post struct {
	ID          int32  `db:"id"`
	AuthorId    int32  `db:"author_id"`
	ParentId    int32  `db:"parent_id"`
	Title       string `db:"title"`
	Published   bool   `db:"published"`
	UpVote      int32  `db:"up_vote"`
	Content     string `db:"content"`
	CreatedAt   int32  `db:"created_at"`
	UpdatedAt   int32  `db:"updated_at"`
	PublishedAt int32  `db:"published_at"`
}

func Delete

func Delete(requestorId int32, postId int32) (bool, *Post)

Delete func

func Publish

func Publish(requestorId int32, postId int32) (bool, *Post)

Publish func

func UnPublish

func UnPublish(requestorId int32, postId int32) (bool, *Post)

UnPublish func

func Update

func Update(newPost *Post) (bool, *Post)

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