repository

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin added in v1.6.5

type Admin struct {
	freedom.Repository
}

Admin .

func (*Admin) Get added in v1.6.5

func (repo *Admin) Get(id int) (adminEntity *entity.Admin, e error)

Get .

type Builder added in v1.7.13

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

Builder .

type Cart

type Cart struct {
	freedom.Repository
}

Cart .

func (*Cart) DeleteAll

func (repo *Cart) DeleteAll(userID int) (e error)

DeleteAll 删除全部购物车

func (*Cart) FindAll

func (repo *Cart) FindAll(userID int) (entitys []*entity.Cart, e error)

FindAll 获取用户购物车实体

func (*Cart) FindByGoodsID added in v1.8.0

func (repo *Cart) FindByGoodsID(userID, goodsID int) (cartEntity *entity.Cart, e error)

FindByGoodsID 获取用户某商品的购物车

func (*Cart) New

func (repo *Cart) New(userID, goodsID, num int) (cartEntity *entity.Cart, e error)

New 新增购物车

func (*Cart) Save

func (repo *Cart) Save(entity *entity.Cart) error

Save 保存购物车

type Delivery added in v1.6.5

type Delivery struct {
	freedom.Repository
}

Delivery .

func (*Delivery) New added in v1.6.5

func (repo *Delivery) New() (deliveryEntity *entity.Delivery, err error)

New 创建实体

func (*Delivery) Save added in v1.6.5

func (repo *Delivery) Save(deliveryEntity *entity.Delivery) error

Save 保存实体

type GORMRepository added in v1.7.13

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

GORMRepository .

type Goods

type Goods struct {
	freedom.Repository
	Cache store.EntityCache //实体缓存组件
}

Goods .

func (*Goods) BeginRequest added in v1.7.4

func (repo *Goods) BeginRequest(worker freedom.Worker)

BeginRequest .

func (*Goods) Finds

func (repo *Goods) Finds(IDs []int) (entitys []*entity.Goods, e error)

Finds .

func (*Goods) FindsByPage

func (repo *Goods) FindsByPage(page, pageSize int, tag string) (entitys []*entity.Goods, e error)

FindsByPage .

func (*Goods) Get added in v1.6.5

func (repo *Goods) Get(ID int) (goodsEntity *entity.Goods, e error)

Get 通过ID 获取商品实体.

func (*Goods) New

func (repo *Goods) New(name, tag string, price, stock int) (entityGoods *entity.Goods, e error)

New .

func (*Goods) Save

func (repo *Goods) Save(entity *entity.Goods) error

Save 持久化实体.

type Order

type Order struct {
	freedom.Repository
	Cache store.EntityCache //实体缓存组件
}

Order .

func (*Order) BeginRequest added in v1.7.4

func (repo *Order) BeginRequest(worker freedom.Worker)

BeginRequest .

func (*Order) Find added in v1.6.1

func (repo *Order) Find(orderNo string, userID int) (orderEntity *entity.Order, e error)

Find .

func (*Order) Finds added in v1.6.1

func (repo *Order) Finds(userID int, page, pageSize int) (entitys []*entity.Order, totalPage int, e error)

Finds .

func (*Order) Get added in v1.6.5

func (repo *Order) Get(orderNo string) (orderEntity *entity.Order, e error)

Get .

func (*Order) New

func (repo *Order) New() (orderEntity *entity.Order, e error)

New 新建订单实体 .

func (*Order) Save

func (repo *Order) Save(orderEntity *entity.Order) (e error)

Save 保存订单实体

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 .

type User

type User struct {
	freedom.Repository
}

User .

func (*User) FindByName

func (repo *User) FindByName(userName string) (userEntity *entity.User, e error)

FindByName .

func (*User) Get added in v1.6.5

func (repo *User) Get(ID int) (userEntity *entity.User, e error)

Get .

func (*User) New

func (repo *User) New(userDto dto.RegisterUserReq, money int) (entityUser *entity.User, e error)

New .

func (*User) Save

func (repo *User) Save(entity *entity.User) error

Save .

Jump to

Keyboard shortcuts

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