demo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEF_DEMO_ENTITY_CACHE_EXPIRE_SECONDS     = 60 * 30
	DEF_DEMO_TOTAL_ROWS_CACHE_EXPIRE_SECONDS = 60 * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DemoEntity

type DemoEntity struct {
	svc.SqlBaseEntity

	Name   string `mysql:"name" json:"name" redis:"name"`
	Status int    `mysql:"status" json:"status" redis:"status"`
}

type DemoSvc

type DemoSvc struct {
	*svc.SqlRedisBindSvc
}

func NewDemoSvc

func NewDemoSvc(alogger golog.ILogger, mclient *mysql.Client, redisKeyPrefix string, rclient *redis.Client) *DemoSvc

func (*DemoSvc) DeleteById

func (d *DemoSvc) DeleteById(id int64) (bool, error)

func (*DemoSvc) GetById

func (d *DemoSvc) GetById(id int64) (*DemoEntity, error)

func (*DemoSvc) Insert

func (d *DemoSvc) Insert(entities ...*DemoEntity) ([]int64, error)

func (*DemoSvc) ListByIds

func (d *DemoSvc) ListByIds(ids ...int64) ([]*DemoEntity, error)

func (*DemoSvc) SimpleQueryAnd

func (d *DemoSvc) SimpleQueryAnd(sqp *svc.SqlQueryParams) ([]*DemoEntity, error)

func (*DemoSvc) UpdateById

func (d *DemoSvc) UpdateById(id int64, newEntity *DemoEntity, updateFields map[string]bool) (bool, error)

Jump to

Keyboard shortcuts

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