article

package
v0.0.0-...-eb64f0e Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound - No result found
	ErrNotFound = errors.New("No result found")
	ErrExist    = errors.New("Already exist")
	// CategoryService expose serviceProvider
	CategoryService *categoryServiceProvider
)
View Source
var (
	// ArticleService expose serviceProvider.
	ArticleService *articleServiceProvider
)
View Source
var (
	//CollectionService expose serviceProvider.
	CollectionService *collectionServiceProvider
)
View Source
var (
	// ArticleService expose serviceProvider.
	CommentService *commentServiceProvider
)

Functions

func UpdateRecommend

func UpdateRecommend()

UpdateRecommend update the recommend

Types

type Article

type Article struct {
	Id         bson.ObjectId `bson:"_id,omitempty"`
	Title      string        `bson:"title"`
	Brief      string        `bson:"brief"`
	Content    string        `bson:"content"`
	AuthorID   uint32        `bson:"authorID"`
	CategoryID bson.ObjectId `bson:"categoryID"`
	TagID      bson.ObjectId `bson:"tagID"`
	VisitNum   int64         `bson:"visitNum"`
	Created    string        `bson:"created"`
	Image      string        `bson:"image"`
	Active     bool          `bson:"active"`
}

Article represents the article information.

type Category

type Category struct {
	Id        bson.ObjectId `bson:"_id,omitempty"   json:"id"`
	Name      string        `bson:"name"            json:"name"`
	ArtNum    int64         `bson:"artNum"          json:"artNum"`
	VisitNum  int64         `bson:"visitNum"        json:"visitnum"`
	Tags      []Tag         `bson:"tags"            json:"tags"`
	Recommend int32         `bson:"recommend"       json:"recommend"`
	Active    bool          `bson:"active"          json:"active"`
}

Category represents the category information.

type Collection

type Collection struct {
	Id     bson.ObjectId   `bson:"_id,omitempty"  json:"id"`
	UserID uint32          `bson:"userID"         json:"userid"`
	ArtID  []bson.ObjectId `bson:"artID"          json:"artid"`
}

Collection represents someone's collection.

type Comment

type Comment struct {
	Id        bson.ObjectId `bson:"_id,omitempty"  json:"id"`
	ArtID     bson.ObjectId `bson:"artID"          json:"artid"`
	Content   string        `bson:"content"        json:"content"`
	CreatorID uint32        `bson:"creatorID"      json:"creatorid"`
	Creator   string        `bson:"creator"        json:"creator"`
	RepliedID uint32        `bson:"repliedID"      json:"repliedid"`
	Replier   string        `bson:"replier"        json:"replier"`
	ParentID  bson.ObjectId `bson:"parentID"       json:"parentid"`
	Created   string        `bson:"created"        json:"created"`
	Status    int8          `bson:"status"         json:"status"`
}

Comment represents the comment information.

type Tag

type Tag struct {
	Id     bson.ObjectId `bson:"id"    json:"id"`
	Name   string        `bson:"name"            json:"name"  validate:"required"`
	Active bool          `bson:"active"          json:"active"`
}

Tag represents the second category.

Jump to

Keyboard shortcuts

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