repository

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 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 Builder added in v1.7.13

type Builder interface {
	Execute(db *gorm.DB, object interface{}) error
}

Builder .

type GORMRepository added in v1.7.13

type GORMRepository interface {
	GetWorker() freedom.Worker
	// contains filtered or unexported methods
}

GORMRepository .

type GoodsInterface

type GoodsInterface interface {
	Get(id int) (po.Goods, error)
	GetAll() ([]po.Goods, error)
	Save(*po.Goods) error
}

GoodsInterface .

type GoodsRepository

type GoodsRepository struct {
	freedom.Repository
}

GoodsRepository .

func (*GoodsRepository) Get

func (repo *GoodsRepository) Get(ID int) (result po.Goods, e error)

Get .

func (*GoodsRepository) GetAll

func (repo *GoodsRepository) GetAll() (result []po.Goods, e error)

GetAll .

func (*GoodsRepository) Save

func (repo *GoodsRepository) Save(goods *po.Goods) (e error)

Save .

type OrderInterface

type OrderInterface interface {
	Get(id int, userID int) (po.Order, error)
	GetAll(userID int) ([]po.Order, error)
	Create(goodsID, num, userID int) error
}

OrderInterface .

type OrderRepository

type OrderRepository struct {
	freedom.Repository
}

OrderRepository .

func (*OrderRepository) Create

func (repo *OrderRepository) Create(goodsID, num, userID int) error

Create .

func (*OrderRepository) Get

func (repo *OrderRepository) Get(ID, userID int) (result po.Order, e error)

Get .

func (*OrderRepository) GetAll

func (repo *OrderRepository) GetAll(userID int) (result []po.Order, e error)

GetAll .

type Pager added in v1.8.1

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

Pager .

func NewAscPager added in v1.8.1

func NewAscPager(column string, columns ...string) *Pager

NewAscPager .

func NewDescPager added in v1.8.1

func NewDescPager(column string, columns ...string) *Pager

NewDescPager .

func (*Pager) Execute added in v1.8.1

func (p *Pager) Execute(db *gorm.DB, object interface{}) (e error)

Execute .

func (*Pager) Order added in v1.8.1

func (p *Pager) Order() interface{}

Order .

func (*Pager) SetPage added in v1.8.1

func (p *Pager) SetPage(page, pageSize int) *Pager

SetPage .

func (*Pager) TotalPage added in v1.8.1

func (p *Pager) TotalPage() int

TotalPage .

Jump to

Keyboard shortcuts

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