service

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountService added in v1.3.7

type AccountService interface {
	statement.Service
	GetUserById(ctx context.Context, username string) (*dto.AccountDTO, error)
	GetAllUsers(ctx context.Context) ([]*dto.AccountDTO, error)
	SaveUser(ctx context.Context, username string, account *dto.AccountDTO) (resp.Response, error)
}

type AccountServiceImpl added in v1.3.7

type AccountServiceImpl struct {
	types.Service      `service:"AccountService"`
	Log                log.Logger `wire:""`
	repository.Factory `wire:"repository_factory"`
}

func (*AccountServiceImpl) GetAllUsers added in v1.3.7

func (r *AccountServiceImpl) GetAllUsers(ctx context.Context) ([]*dto.AccountDTO, error)

func (*AccountServiceImpl) GetUserById added in v1.3.7

func (r *AccountServiceImpl) GetUserById(ctx context.Context, username string) (*dto.AccountDTO, error)

func (*AccountServiceImpl) SaveUser added in v1.3.7

func (r *AccountServiceImpl) SaveUser(ctx context.Context, username string, account *dto.AccountDTO) (resp.Response, error)

type Api

type Api struct {
	Method string
	Url    string
	Params []Param
}

type ControllerModel

type ControllerModel struct {
	Controller string
	APIs       []Api
}

type DemoCacheService

type DemoCacheService interface {
	statement.Service
	SaveCache(key, val string) interface{}
	GetFromCache(key string) interface{}
}

type DemoCacheServiceImpl added in v1.4.0

type DemoCacheServiceImpl struct {
	types.Service `service:"DemoCacheService"`
	Cache         cache.ICache `wire:""` //使用cache注入缓存实现
}

func (*DemoCacheServiceImpl) GetFromCache added in v1.4.0

func (r *DemoCacheServiceImpl) GetFromCache(key string) interface{}

func (*DemoCacheServiceImpl) SaveCache added in v1.4.0

func (r *DemoCacheServiceImpl) SaveCache(key, val string) interface{}

type Factory added in v1.4.0

type Factory interface {
	GetAccountService() AccountService
	GetDemoCacheService() DemoCacheService
	GetRouteService() RouteService
}

type FactoryImpl added in v1.4.0

type FactoryImpl struct {
	types.Component  `name:"service_factory"`
	AccountService   AccountService   `wire:""`
	DemoCacheService DemoCacheService `wire:""`
	RouteService     RouteService     `wire:""`
}

func (*FactoryImpl) GetAccountService added in v1.4.0

func (f *FactoryImpl) GetAccountService() AccountService

func (*FactoryImpl) GetDemoCacheService added in v1.4.0

func (f *FactoryImpl) GetDemoCacheService() DemoCacheService

func (*FactoryImpl) GetRouteService added in v1.4.0

func (f *FactoryImpl) GetRouteService() RouteService

type Param added in v1.4.3

type Param struct {
	Name   string
	Source string
	Type   string
}

type RouteService

type RouteService interface {
	statement.Service
	Apis() resp.Response
}

type RouteServiceImpl added in v1.4.0

type RouteServiceImpl struct {
	types.Service `service:"RouteService"`
	Controllers   []web.Controller `wire:""`                      //使用切片接口类型注入所有实现类
	AppName       string           `value:"application.app_name"` //使用value标签实现配置文件注入
}

func (*RouteServiceImpl) Apis added in v1.4.0

func (t *RouteServiceImpl) Apis() resp.Response

Jump to

Keyboard shortcuts

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