feat: 新增简易版ioc

This commit is contained in:
meilin.huang
2024-01-21 22:52:20 +08:00
parent f4a64b96a9
commit f27d3d200f
106 changed files with 815 additions and 707 deletions

View File

@@ -19,16 +19,15 @@ type AuthCert interface {
GetByIds(ids ...uint64) []*entity.AuthCert
}
func newAuthCertApp(authCertRepo repository.AuthCert) AuthCert {
return &authCertAppImpl{
base.AppImpl[*entity.AuthCert, repository.AuthCert]{Repo: authCertRepo},
}
}
type authCertAppImpl struct {
base.AppImpl[*entity.AuthCert, repository.AuthCert]
}
// 注入AuthCertRepo
func (a *authCertAppImpl) InjectAuthCertRepo(repo repository.AuthCert) {
a.Repo = repo
}
func (a *authCertAppImpl) GetPageList(condition *entity.AuthCertQuery, pageParam *model.PageParam, toEntity any, orderBy ...string) (*model.PageResult[any], error) {
return a.GetRepo().GetPageList(condition, pageParam, toEntity)
}