67 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package system
 | |
| 
 | |
| import (
 | |
| 	db "management/internal/db/sqlc"
 | |
| 	"management/internal/pkg/redis"
 | |
| 	"management/internal/pkg/session"
 | |
| )
 | |
| 
 | |
| type SystemBiz interface {
 | |
| 	UserBiz() UserBiz
 | |
| 	MenuBiz() MenuBiz
 | |
| 	RoleBiz() RoleBiz
 | |
| 	DepartmentBiz() DepartmentBiz
 | |
| 	ConfigBiz() ConfigBiz
 | |
| 	AuditBiz() AuditBiz
 | |
| 	LoginLogBiz() LoginLogBiz
 | |
| 	CategoryBiz() CategoryBiz
 | |
| }
 | |
| 
 | |
| 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)
 | |
| }
 | |
| 
 | |
| func (b *systemBiz) RoleBiz() RoleBiz {
 | |
| 	return NewRole(b.store, b.redis)
 | |
| }
 | |
| 
 | |
| func (b *systemBiz) DepartmentBiz() DepartmentBiz {
 | |
| 	return NewDepartment(b.store, b.redis)
 | |
| }
 | |
| 
 | |
| func (b *systemBiz) ConfigBiz() ConfigBiz {
 | |
| 	return NewConfig(b.store, b.redis)
 | |
| }
 | |
| 
 | |
| func (b *systemBiz) AuditBiz() AuditBiz {
 | |
| 	return NewAudit(b.store)
 | |
| }
 | |
| 
 | |
| func (b *systemBiz) LoginLogBiz() LoginLogBiz {
 | |
| 	return NewLoginLog(b.store)
 | |
| }
 | |
| 
 | |
| func (b *systemBiz) CategoryBiz() CategoryBiz {
 | |
| 	return NewCategory(b.store, b.redis)
 | |
| }
 |