data

package
v0.0.0-...-d16b773 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: MIT, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleRepo

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

func NewArticleRepo

func NewArticleRepo(engine *gorm.DB) *ArticleRepo

func (*ArticleRepo) Create

func (r *ArticleRepo) Create(article *models.Article) error

Create 创建文章.

func (*ArticleRepo) GetByCond

func (r *ArticleRepo) GetByCond(cond map[string]interface{}) (*models.Article, error)

GetByCond 根据条件获取文章.

type CategoryRepo

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

func NewCategoryRepo

func NewCategoryRepo(engine *gorm.DB) *CategoryRepo

func (*CategoryRepo) Create

func (r *CategoryRepo) Create(value *models.Category) error

Create 创建分类.

func (*CategoryRepo) FindByCond

func (r *CategoryRepo) FindByCond(cond map[string]interface{}) ([]*models.Category, error)

FindByCond 根据条件搜索分类.

func (*CategoryRepo) GetByCond

func (r *CategoryRepo) GetByCond(cond map[string]interface{}) (*models.Category, error)

GetByCond 根据条件查询分类.

func (*CategoryRepo) UpdateByIdAndCond

func (r *CategoryRepo) UpdateByIdAndCond(id uint, cond map[string]interface{}) error

UpdateByIdAndCond 根据id和条件更新.

type UserRepo

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

func NewUserRepo

func NewUserRepo(engine *gorm.DB) *UserRepo

func (*UserRepo) Create

func (r *UserRepo) Create(value *models.User) error

Create 创建用户.

func (*UserRepo) ExistByCond

func (r *UserRepo) ExistByCond(cond map[string]interface{}) (has bool, err error)

ExistByCond 根据条件判断是否存在.

func (*UserRepo) GetByCond

func (r *UserRepo) GetByCond(cond map[string]interface{}) (*models.User, error)

GetByCond 根据条件查询用户.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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