pkg

package
v0.0.0-...-c61ee60 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID      int64  `gorm:"primarykey"`
	Title   string `gorm:"type:varchar(40)"`
	Content string `gorm:"type:varchar(255)"`
	Author  int64
}

func (*Article) BeforeCreate

func (a *Article) BeforeCreate(_ *gorm.DB) (err error)

BeforeCreate uses snowflake to generate an ID.

type ArticleManager

type ArticleManager struct {
	// contains filtered or unexported fields
}

func NewArticleManager

func NewArticleManager(db *gorm.DB) *ArticleManager

NewArticleManager creates a mysql manager.

func (*ArticleManager) Post

func (a *ArticleManager) Post(title, content string, uid int64) error

type UserManager

type UserManager struct {
	UserClient userservice.Client
}

func (*UserManager) ArticleNumPlusOne

func (u *UserManager) ArticleNumPlusOne(uid int64) error

Jump to

Keyboard shortcuts

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