v2
This commit is contained in:
51
internal/erpserver/biz/v1/system/system.go
Normal file
51
internal/erpserver/biz/v1/system/system.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
db "management/internal/db/sqlc"
|
||||
"management/internal/pkg/redis"
|
||||
"management/internal/pkg/session"
|
||||
)
|
||||
|
||||
type SystemBiz interface {
|
||||
UserBiz() UserBiz
|
||||
MenuBiz() MenuBiz
|
||||
DepartmentBiz() DepartmentBiz
|
||||
AuditBiz() AuditBiz
|
||||
ConfigBiz() ConfigBiz
|
||||
}
|
||||
|
||||
type systemBiz struct {
|
||||
store db.Store
|
||||
redis redis.IRedis
|
||||
session session.ISession
|
||||
}
|
||||
|
||||
var _ SystemBiz = (*systemBiz)(nil)
|
||||
|
||||
func New(store db.Store, redis redis.IRedis, session session.ISession) *systemBiz {
|
||||
return &systemBiz{
|
||||
store: store,
|
||||
redis: redis,
|
||||
session: session,
|
||||
}
|
||||
}
|
||||
|
||||
func (b *systemBiz) UserBiz() UserBiz {
|
||||
return NewUser(b.store, b.session)
|
||||
}
|
||||
|
||||
func (b *systemBiz) MenuBiz() MenuBiz {
|
||||
return NewMenu(b.store, b.redis, b.session)
|
||||
}
|
||||
|
||||
func (b *systemBiz) DepartmentBiz() DepartmentBiz {
|
||||
return NewDepartment(b.store, b.redis, b.session)
|
||||
}
|
||||
|
||||
func (b *systemBiz) AuditBiz() AuditBiz {
|
||||
return NewAudit(b.store)
|
||||
}
|
||||
|
||||
func (b *systemBiz) ConfigBiz() ConfigBiz {
|
||||
return NewConfig(b.store, b.redis, b.session)
|
||||
}
|
||||
Reference in New Issue
Block a user