Documentation
¶
Index ¶
- Variables
- func GetExampleRepoWireSet() wire.ProviderSet
- func GetKeyExampleRepository(ns ...string) string
- func GetKeyHealthRepository(ns ...string) string
- func RegisterKeyExampleRepository(ctx frame.ContextFramer, ns ...string) string
- func RegisterKeyHealthRepository(ctx frame.ContextFramer, ns ...string) string
- type ExampleRepository
- type HealthRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ExampleRepoWireSet = wire.NewSet(NewExampleRepository)
)
Functions ¶
func GetExampleRepoWireSet ¶
func GetExampleRepoWireSet() wire.ProviderSet
func GetKeyExampleRepository ¶
GetKeyExampleRepository 获取 ExampleRepository 注册键名
func GetKeyHealthRepository ¶
func RegisterKeyExampleRepository ¶
func RegisterKeyExampleRepository(ctx frame.ContextFramer, ns ...string) string
RegisterKeyExampleRepository 注册 ExampleRepository 到容器(延迟初始化)并返回注册key;由上层服务层作为依赖组件的属性key使用,既实现了延迟初始化单例,又实现了依赖注入 见 api.CommonHandler 示例,引用了 service.TestService 作为依赖组件,并通过 service.RegisterKeyTestService(ctx) 注册依赖组件到容器并返回注册key
func RegisterKeyHealthRepository ¶
func RegisterKeyHealthRepository(ctx frame.ContextFramer, ns ...string) string
Types ¶
type ExampleRepository ¶
type ExampleRepository struct {
frame.RepositoryLocator
Model *model.ExampleModel
}
ExampleRepository Example仓库,负责Example业务的数据持久化操作,继承frame.RepositoryLocator仓库定位器接口,具备获取上下文、配置、日志、注册实例等功能
func NewExampleRepository ¶
func NewExampleRepository(ctx frame.ContextFramer, m *model.ExampleModel) *ExampleRepository
func (*ExampleRepository) CreateExample ¶
func (r *ExampleRepository) CreateExample(req *requestvo.ExampleReqVo) (string, error)
CreateExample 创建Example示例数据
func (*ExampleRepository) GetExampleById ¶
func (r *ExampleRepository) GetExampleById(id string) (*entity.Example, error)
GetExampleById 根据ID获取Example示例数据
func (*ExampleRepository) GetExamples ¶
func (r *ExampleRepository) GetExamples(page, size int) ([]entity.Example, error)
GetExamples 分页获取Example示例数据
type HealthRepository ¶
type HealthRepository struct {
frame.RepositoryLocator
Status string
}
func NewHealthRepository ¶
func NewHealthRepository(ctx frame.ContextFramer) *HealthRepository
func (*HealthRepository) Test ¶
func (h *HealthRepository) Test() error
Click to show internal directories.
Click to hide internal directories.