article

package
v0.0.0-...-eda2346 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceDB = "article"
View Source
const ServiceDBArticleCollection = "article"

Variables

This section is empty.

Functions

func GetNoDBArticleCC

func GetNoDBArticleCC() *mongo.Collection

Types

type Article

type Article struct {
	ID             string `bson:"id"`
	Title          string `bson:"title"`
	Summary        string `bson:"summary"`
	Content        string `bson:"content"`
	CreateByUserID string `bson:"create_by_user_id"`
	TotalReadTimes int    `bson:"total_read_times"`
	CreateAt       string `bson:"create_at"`
}

func (*Article) Save

func (m *Article) Save(ctx context.Context) error

Create a new article when ID is empty Or else update title,summary,content

type Articles

type Articles struct{}

func (*Articles) HomeList

func (m *Articles) HomeList(ctx context.Context) ([]*Article, error)

it usually be cache in the frontend get the latest 4 articles

Jump to

Keyboard shortcuts

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