repository

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExampleRepoWireSet = wire.NewSet(NewExampleRepository)
)

Functions

func GetExampleRepoWireSet

func GetExampleRepoWireSet() wire.ProviderSet

func GetKeyExampleRepository

func GetKeyExampleRepository(ns ...string) string

GetKeyExampleRepository 获取 ExampleRepository 注册键名

func GetKeyHealthRepository

func GetKeyHealthRepository(ns ...string) string

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 (*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

Jump to

Keyboard shortcuts

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