blog

package
v0.0.0-...-160a03f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateArticle

func CreateArticle(article Article) bool

func CreateTag

func CreateTag(tag Tag) bool

func DeleteArticle

func DeleteArticle(id int64) bool

func DeleteTags

func DeleteTags(id int64) bool

func ExistArticle

func ExistArticle(id int64) bool

func ExistTag

func ExistTag(id int64) bool

func ExistUser

func ExistUser(username string, password string) bool

func GetArticleCount

func GetArticleCount(maps map[string]interface{}) (count int64)

func GetTagCount

func GetTagCount(maps map[string]interface{}) (count int64)

func UpdateArticle

func UpdateArticle(id int64, article Article) bool

func UpdateTag

func UpdateTag(id int64, tag Tag) bool

Types

type Article

type Article struct {
	ID        int64  `json:"id"` //gorm 约定主键
	Title     string `json:"title"`
	Content   string `json:"content"`
	TagId     int64  `json:"tag_id" gorm:"index"`
	Tag       Tag    `json:"tag"`
	Desc      string `json:"desc"`
	CreatedAt int    `json:"created_at"` //gorm 约定创建时间字段
	CreateBy  string `json:"create_by"`
	UpdatedAt int    `json:"updated_at"` //gorm 约定更新时间字段
	ModifyBy  string `json:"modify_by"`
	DeleteOn  int    `json:"delete_on"`
	State     int    `json:"state"`
}

func GetArticle

func GetArticle(pageNum int, pageSize int, maps map[string]interface{}) (articles []Article)

type Auth

type Auth struct {
	ID       int64  `json:"id"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type Tag

type Tag struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	CreatedAt int    `json:"created_at"`
	CreateBy  string `json:"create_by"`
	UpdatedAt int    `json:"updated_at"`
	ModifyBy  string `json:"modify_by"`
	State     *int   `json:"state"`
}

func GetTags

func GetTags(pageNum int, pageSize int, maps interface{}) (tags []Tag)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳