svc

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFormat

func DefaultFormat(interface{}) func(interface{}) interface{}

DefaultFormat defined

func DefaultHandler

func DefaultHandler(source map[string]interface{}) map[string]interface{}

DefaultHandler defined

func OptionsetsFormat

func OptionsetsFormat(db *xorm.Engine) func(interface{}) func(interface{}) interface{}

OptionsetsFormat defiend

Types

type Client added in v1.2.12

type Client interface {
	// Get returns *HttpRequest with GET method.
	Get(url string) *client.HttpRequest
	// Post returns *HttpRequest with POST method.
	Post(url string) *client.HttpRequest
	// Put returns *HttpRequest with PUT method.
	Put(url string) *client.HttpRequest
	// Delete returns *HttpRequest DELETE method.
	Delete(url string) *client.HttpRequest
	// Head returns *HttpRequest with HEAD method.
	Head(url string) *client.HttpRequest
}

XClient defined TODO

type DB added in v1.2.12

type DB interface {
	PageSearch(*xorm.Engine, string, string, string, map[string]interface{}, ...Formatter) (*types.PageList, error)
	TreeSearch(*xorm.Engine, string, string, string, map[string]interface{}, ...Formatter) (interface{}, error)
	GetOptions(*xorm.Engine, ...string) (map[string]map[string]interface{}, error)
	InRole(*xorm.Engine, string, ...string) bool
	InAdmin(*xorm.Engine, string, ...string) bool
	Persist(db *xorm.Session, ids ...string) (int64, error)
	PersistFile(db *xorm.Session, cb func([]types.SysAttachment) error, ids ...string) (int64, error)
	Remove(db *xorm.Session, ids ...string) (int64, error)
	RemoveFile(db *xorm.Session, cb func([]types.SysAttachment) error, ids ...string) (int64, error)
}

DB defined TODO

type Formatter

type Formatter func(*xorm.Engine, []map[string]interface{}) ([]map[string]interface{}, error)

Formatter defined TODO

type Report added in v1.2.12

type Report interface {
	Check(*http.Request) bool
	PageExport(*xorm.Engine, string, string, string, map[string]interface{}, ...Formatter) (*types.ExportInfo, error)
	ParseExcel(r io.Reader, sheet interface{}, header ...[]map[string]interface{}) ([]map[string]string, error)
	SetOptionsetsFormat(func(interface{}) func(interface{}) interface{})
}

Report defined TODO

type ServiceContext added in v1.2.12

type ServiceContext struct {
	Report Report
	Store  Store
	Client Client
	DB     DB
}

ServiceContext defined TODO

func NewServiceContext added in v1.2.12

func NewServiceContext(cache persistence.CacheStore) *ServiceContext

NewServiceContext defined TODO ====================================================================== ====================================================================== ======================================================================

type Store added in v1.2.12

type Store interface {
	Get(key string, value interface{}) error
	Set(key string, value interface{}, expire time.Duration) error
	Add(key string, value interface{}, expire time.Duration) error
	Replace(key string, data interface{}, expire time.Duration) error
	Delete(key string) error
	Increment(key string, data uint64) (uint64, error)
	Decrement(key string, data uint64) (uint64, error)
	Flush() error
}

Store defined TODO

type XClient added in v1.2.12

type XClient struct{}

XClient defined TODO

func NewXClient added in v1.2.12

func NewXClient() *XClient

NewXClient defined TODO

func (*XClient) Delete added in v1.2.12

func (x *XClient) Delete(url string) *client.HttpRequest

Delete returns *HttpRequest DELETE method.

func (*XClient) Get added in v1.2.12

func (x *XClient) Get(url string) *client.HttpRequest

XClient defined TODO ====================================================================== ====================================================================== ====================================================================== Get returns *HttpRequest with GET method.

func (*XClient) Head added in v1.2.12

func (x *XClient) Head(url string) *client.HttpRequest

Head returns *HttpRequest with HEAD method.

func (*XClient) Post added in v1.2.12

func (x *XClient) Post(url string) *client.HttpRequest

Post returns *HttpRequest with POST method.

func (*XClient) Put added in v1.2.12

func (x *XClient) Put(url string) *client.HttpRequest

Put returns *HttpRequest with PUT method.

type XDB added in v1.2.12

type XDB struct{}

XDB defined TODO

func NewXDB added in v1.2.12

func NewXDB() *XDB

NewXDB defined TODO

func (*XDB) GetOptions added in v1.2.12

func (x *XDB) GetOptions(db *xorm.Engine, keys ...string) (map[string]map[string]interface{}, error)

GetOptions defined TODO

func (*XDB) InAdmin added in v1.2.12

func (x *XDB) InAdmin(db *xorm.Engine, userId string, role ...string) bool

InAdmin defined TODO

func (*XDB) InRole added in v1.2.12

func (x *XDB) InRole(db *xorm.Engine, userId string, role ...string) bool

XDB defined TODO ====================================================================== ====================================================================== ====================================================================== InRole defined TODO

func (*XDB) PageSearch added in v1.2.12

func (x *XDB) PageSearch(db *xorm.Engine, ctr, api, table string, params map[string]interface{}, formatters ...Formatter) (*types.PageList, error)

PageSearch defined TODO

func (*XDB) Persist added in v1.2.12

func (x *XDB) Persist(db *xorm.Session, ids ...string) (int64, error)

Persist defined TODO

func (*XDB) PersistFile added in v1.2.12

func (x *XDB) PersistFile(db *xorm.Session, cb func([]types.SysAttachment) error, ids ...string) (int64, error)

PersistFile defined TODO

func (*XDB) Remove added in v1.2.12

func (x *XDB) Remove(db *xorm.Session, ids ...string) (int64, error)

Remove defined TODO

func (*XDB) RemoveFile added in v1.2.12

func (x *XDB) RemoveFile(db *xorm.Session, cb func([]types.SysAttachment) error, ids ...string) (int64, error)

RemoveFile defined TODO

func (*XDB) TreeSearch added in v1.2.12

func (x *XDB) TreeSearch(db *xorm.Engine, controller, api, table string, q map[string]interface{}, formatters ...Formatter) (interface{}, error)

TreeSearch defined TODO

type XReport added in v1.2.12

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

XReport defined TODO

func NewXReport added in v1.2.12

func NewXReport() *XReport

NewXReport defined TODO

func (*XReport) Check added in v1.2.12

func (x *XReport) Check(request *http.Request) bool

XReport defined TODO ====================================================================== ====================================================================== ====================================================================== Check defined TODO

func (*XReport) PageExport added in v1.2.12

func (x *XReport) PageExport(db *xorm.Engine, ctr, api, table string, params map[string]interface{}, formatters ...Formatter) (*types.ExportInfo, error)

PageExport defined TODO

func (*XReport) ParseExcel added in v1.2.12

func (x *XReport) ParseExcel(r io.Reader, sheet interface{}, header ...[]map[string]interface{}) ([]map[string]string, error)

ParseExcel defined TODO

func (*XReport) SetOptionsetsFormat added in v1.2.12

func (svc *XReport) SetOptionsetsFormat(funk func(interface{}) func(interface{}) interface{})

SetOptionsetsFormat definedTODO

type Xlsx

type Xlsx struct {
	SheetIndex interface{}
	FileName   string
	SheetName  string
	Header     []map[string]interface{}
	TmplPath   string
	Format     func(interface{}) func(interface{}) interface{}
	Handler    func(map[string]interface{}) map[string]interface{}
	// contains filtered or unexported fields
}

Xlsx defined TODO

func NewXlsx

func NewXlsx(header ...[]map[string]interface{}) *Xlsx

NewXlsx defined TODO

func (*Xlsx) DumpRows

func (xlsx *Xlsx) DumpRows(rows ...map[string]interface{}) *Xlsx

DumpRows defined TODO

func (*Xlsx) ExportInfo

func (xlsx *Xlsx) ExportInfo() *types.ExportInfo

ExportInfo defined TODO

func (*Xlsx) ParseExcel

func (xlsx *Xlsx) ParseExcel(r io.Reader, header ...[]map[string]interface{}) ([]map[string]string, error)

ParseExcel defined TODO

Jump to

Keyboard shortcuts

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