mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-09 17:30:25 +08:00
feat: 新增简易版ioc
This commit is contained in:
@@ -30,16 +30,15 @@ type Instance interface {
|
||||
GetDatabases(entity *entity.DbInstance) ([]string, error)
|
||||
}
|
||||
|
||||
func newInstanceApp(instanceRepo repository.Instance) Instance {
|
||||
app := new(instanceAppImpl)
|
||||
app.Repo = instanceRepo
|
||||
return app
|
||||
}
|
||||
|
||||
type instanceAppImpl struct {
|
||||
base.AppImpl[*entity.DbInstance, repository.Instance]
|
||||
}
|
||||
|
||||
// 注入DbInstanceRepo
|
||||
func (i *instanceAppImpl) InjectDbInstanceRepo(repo repository.Instance) {
|
||||
i.Repo = repo
|
||||
}
|
||||
|
||||
// GetPageList 分页获取数据库实例
|
||||
func (app *instanceAppImpl) GetPageList(condition *entity.InstanceQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
|
||||
return app.GetRepo().GetInstanceList(condition, pageParam, toEntity, orderBy...)
|
||||
|
||||
Reference in New Issue
Block a user