Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
29 lines
909 B
Go
29 lines
909 B
Go
package bootstrap
|
|
|
|
import (
|
|
"github.com/break/junhong_cmp_fiber/internal/store/postgres"
|
|
)
|
|
|
|
// stores 封装所有 Store 实例
|
|
// 注意:此结构体不导出,仅在 bootstrap 包内部使用
|
|
type stores struct {
|
|
Account *postgres.AccountStore
|
|
Role *postgres.RoleStore
|
|
Permission *postgres.PermissionStore
|
|
AccountRole *postgres.AccountRoleStore
|
|
RolePermission *postgres.RolePermissionStore
|
|
// TODO: 新增 Store 在此添加字段
|
|
}
|
|
|
|
// initStores 初始化所有 Store 实例
|
|
func initStores(deps *Dependencies) *stores {
|
|
return &stores{
|
|
Account: postgres.NewAccountStore(deps.DB, deps.Redis),
|
|
Role: postgres.NewRoleStore(deps.DB),
|
|
Permission: postgres.NewPermissionStore(deps.DB),
|
|
AccountRole: postgres.NewAccountRoleStore(deps.DB),
|
|
RolePermission: postgres.NewRolePermissionStore(deps.DB),
|
|
// TODO: 新增 Store 在此初始化
|
|
}
|
|
}
|