Documentation
¶
Index ¶
- type BaseRepository
- type OrganizationRepository
- func (e *OrganizationRepository) Count(tx *gorm.DB, searchParams *OrganizationSearch) (int64, error)
- func (e *OrganizationRepository) Delete(tx *gorm.DB, filterContext *OrganizationSearch, itemId uuid.UUID) error
- func (e *OrganizationRepository) DeleteByIds(tx *gorm.DB, filterContext *OrganizationSearch, itemIds []uuid.UUID) error
- func (e *OrganizationRepository) Deleted(tx *gorm.DB, searchParams *OrganizationSearch) ([]string, error)
- func (e *OrganizationRepository) FindAll(tx *gorm.DB, filterContext *OrganizationSearch, pageSize int, page int) ([]*model.Organization, error)
- func (e *OrganizationRepository) FindById(tx *gorm.DB, filterContext *OrganizationSearch, itemId uuid.UUID) (*model.Organization, error)
- func (e *OrganizationRepository) FindByIds(tx *gorm.DB, filterContext *OrganizationSearch, itemIds []uuid.UUID) ([]*model.Organization, error)
- func (e *OrganizationRepository) GetDB() *gorm.DB
- func (e *OrganizationRepository) Save(tx *gorm.DB, filterContext *OrganizationSearch, item *model.Organization) (*model.Organization, error)
- func (e *OrganizationRepository) SaveMany(tx *gorm.DB, filterContext *OrganizationSearch, item []*model.Organization) ([]*model.Organization, error)
- func (e *OrganizationRepository) Search(tx *gorm.DB, searchParams *OrganizationSearch) ([]*model.Organization, error)
- func (e *OrganizationRepository) Update(tx *gorm.DB, filterContext *OrganizationSearch, item *model.Organization) (*model.Organization, error)
- func (e *OrganizationRepository) UpdateMany(tx *gorm.DB, filterContext *OrganizationSearch, items []*model.Organization) ([]*model.Organization, error)
- type OrganizationSearch
- type SystemUserOrganizationRepository
- func (e *SystemUserOrganizationRepository) Count(tx *gorm.DB, searchParams *SystemUserOrganizationSearch) (int64, error)
- func (e *SystemUserOrganizationRepository) Delete(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, itemId uuid.UUID) error
- func (e *SystemUserOrganizationRepository) DeleteByIds(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, itemIds []uuid.UUID) error
- func (e *SystemUserOrganizationRepository) Deleted(tx *gorm.DB, searchParams *SystemUserOrganizationSearch) ([]string, error)
- func (e *SystemUserOrganizationRepository) FindAll(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, pageSize int, ...) ([]*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationRepository) FindById(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, itemId uuid.UUID) (*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationRepository) FindByIds(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, itemIds []uuid.UUID) ([]*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationRepository) GetDB() *gorm.DB
- func (e *SystemUserOrganizationRepository) Save(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, ...) (*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationRepository) SaveMany(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, ...) ([]*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationRepository) Search(tx *gorm.DB, searchParams *SystemUserOrganizationSearch) ([]*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationRepository) Update(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, ...) (*model.SystemUserOrganization, error)
- func (e *SystemUserOrganizationRepository) UpdateMany(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, ...) ([]*model.SystemUserOrganization, error)
- type SystemUserOrganizationSearch
- type SystemUserRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseRepository ¶
type BaseRepository[T any, K comparable, S any] interface { // GetDB returns the gorm.DB instance. GetDB() *gorm.DB // Save saves a single entity. // filterContext provides additional context for the operation. // item is the entity to be saved. // tx is an optional transaction. If nil, the default DB is used. Save(tx *gorm.DB, filterContext *S, item *T) (*T, error) // SaveMany saves multiple entities. // filterContext provides additional context for the operation. // item is the list of entities to be saved. // tx is an optional transaction. If nil, the default DB is used. SaveMany(tx *gorm.DB, filterContext *S, item []*T) ([]*T, error) // Update updates a single entity. // filterContext provides additional context for the operation. // item is the entity to be updated. // tx is an optional transaction. If nil, the default DB is used. Update(tx *gorm.DB, filterContext *S, item *T) (*T, error) // UpdateMany updates multiple entities. // filterContext provides additional context for the operation. // item is the list of entities to be updated. // tx is an optional transaction. If nil, the default DB is used. UpdateMany(tx *gorm.DB, filterContext *S, item []*T) ([]*T, error) // Delete deletes a single entity by its ID. // searchParams provides additional context for the operation. // itemId is the ID of the entity to be deleted. // tx is an optional transaction. If nil, the default DB is used. Delete(tx *gorm.DB, searchParams *S, itemId K) error // DeleteByIds deletes multiple entities by their IDs. // searchParams provides additional context for the operation. // itemIds is the list of IDs of the entities to be deleted. // tx is an optional transaction. If nil, the default DB is used. DeleteByIds(tx *gorm.DB, searchParams *S, itemIds []K) error // FindById finds a single entity by its ID. // searchParams provides additional context for the operation. // itemId is the ID of the entity to be found. // tx is an optional transaction. If nil, the default DB is used. FindById(tx *gorm.DB, searchParams *S, itemId K) (*T, error) // FindByIds finds multiple entities by their IDs. // searchParams provides additional context for the operation. // itemIds is the list of IDs of the entities to be found. // tx is an optional transaction. If nil, the default DB is used. FindByIds(tx *gorm.DB, searchParams *S, itemIds []K) ([]*T, error) // FindAll finds all entities with pagination. // searchParams provides additional context for the operation. // pageSize is the number of entities per page. // page is the current page number. // tx is an optional transaction. If nil, the default DB is used. FindAll(tx *gorm.DB, searchParams *S, pageSize int, page int) ([]*T, error) // Search searches for entities based on search parameters. // searchParams provides the criteria for the search. // tx is an optional transaction. If nil, the default DB is used. Search(tx *gorm.DB, searchParams *S) ([]*T, error) // Count counts the number of entities based on search parameters. // searchParams provides the criteria for the count. // tx is an optional transaction. If nil, the default DB is used. Count(tx *gorm.DB, searchParams *S) (int64, error) // Deleted returns a list of IDs of deleted entities based on search parameters. // searchParams provides the criteria for the search. // tx is an optional transaction. If nil, the default DB is used. Deleted(tx *gorm.DB, searchParams *S) ([]string, error) }
BaseRepository defines a generic repository interface for CRUD operations. T represents the type of the entity. K represents the type of the entity's ID. S represents the type of the search parameters. Many methods accept an optional *gorm.DB transaction (tx). If tx is nil, the default DB connection is used.
func NewOrganizationRepository ¶
func NewOrganizationRepository(Db *gorm.DB) BaseRepository[model.Organization, uuid.UUID, OrganizationSearch]
func NewSystemUserOrganizationRepository ¶
func NewSystemUserOrganizationRepository(Db *gorm.DB) BaseRepository[model.SystemUserOrganization, uuid.UUID, SystemUserOrganizationSearch]
type OrganizationRepository ¶
func (*OrganizationRepository) Count ¶
func (e *OrganizationRepository) Count(tx *gorm.DB, searchParams *OrganizationSearch) (int64, error)
func (*OrganizationRepository) Delete ¶
func (e *OrganizationRepository) Delete(tx *gorm.DB, filterContext *OrganizationSearch, itemId uuid.UUID) error
func (*OrganizationRepository) DeleteByIds ¶
func (e *OrganizationRepository) DeleteByIds(tx *gorm.DB, filterContext *OrganizationSearch, itemIds []uuid.UUID) error
func (*OrganizationRepository) Deleted ¶
func (e *OrganizationRepository) Deleted(tx *gorm.DB, searchParams *OrganizationSearch) ([]string, error)
func (*OrganizationRepository) FindAll ¶
func (e *OrganizationRepository) FindAll(tx *gorm.DB, filterContext *OrganizationSearch, pageSize int, page int) ([]*model.Organization, error)
func (*OrganizationRepository) FindById ¶
func (e *OrganizationRepository) FindById(tx *gorm.DB, filterContext *OrganizationSearch, itemId uuid.UUID) (*model.Organization, error)
func (*OrganizationRepository) FindByIds ¶
func (e *OrganizationRepository) FindByIds(tx *gorm.DB, filterContext *OrganizationSearch, itemIds []uuid.UUID) ([]*model.Organization, error)
func (*OrganizationRepository) GetDB ¶
func (e *OrganizationRepository) GetDB() *gorm.DB
func (*OrganizationRepository) Save ¶
func (e *OrganizationRepository) Save(tx *gorm.DB, filterContext *OrganizationSearch, item *model.Organization) (*model.Organization, error)
func (*OrganizationRepository) SaveMany ¶
func (e *OrganizationRepository) SaveMany(tx *gorm.DB, filterContext *OrganizationSearch, item []*model.Organization) ([]*model.Organization, error)
func (*OrganizationRepository) Search ¶
func (e *OrganizationRepository) Search(tx *gorm.DB, searchParams *OrganizationSearch) ([]*model.Organization, error)
func (*OrganizationRepository) Update ¶
func (e *OrganizationRepository) Update(tx *gorm.DB, filterContext *OrganizationSearch, item *model.Organization) (*model.Organization, error)
func (*OrganizationRepository) UpdateMany ¶
func (e *OrganizationRepository) UpdateMany(tx *gorm.DB, filterContext *OrganizationSearch, items []*model.Organization) ([]*model.Organization, error)
type OrganizationSearch ¶
type SystemUserOrganizationRepository ¶
func (*SystemUserOrganizationRepository) Count ¶
func (e *SystemUserOrganizationRepository) Count(tx *gorm.DB, searchParams *SystemUserOrganizationSearch) (int64, error)
func (*SystemUserOrganizationRepository) Delete ¶
func (e *SystemUserOrganizationRepository) Delete(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, itemId uuid.UUID) error
func (*SystemUserOrganizationRepository) DeleteByIds ¶
func (e *SystemUserOrganizationRepository) DeleteByIds(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, itemIds []uuid.UUID) error
func (*SystemUserOrganizationRepository) Deleted ¶
func (e *SystemUserOrganizationRepository) Deleted(tx *gorm.DB, searchParams *SystemUserOrganizationSearch) ([]string, error)
func (*SystemUserOrganizationRepository) FindAll ¶
func (e *SystemUserOrganizationRepository) FindAll(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, pageSize int, page int) ([]*model.SystemUserOrganization, error)
func (*SystemUserOrganizationRepository) FindById ¶
func (e *SystemUserOrganizationRepository) FindById(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, itemId uuid.UUID) (*model.SystemUserOrganization, error)
func (*SystemUserOrganizationRepository) FindByIds ¶
func (e *SystemUserOrganizationRepository) FindByIds(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, itemIds []uuid.UUID) ([]*model.SystemUserOrganization, error)
func (*SystemUserOrganizationRepository) GetDB ¶
func (e *SystemUserOrganizationRepository) GetDB() *gorm.DB
func (*SystemUserOrganizationRepository) Save ¶
func (e *SystemUserOrganizationRepository) Save(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, item *model.SystemUserOrganization) (*model.SystemUserOrganization, error)
func (*SystemUserOrganizationRepository) SaveMany ¶
func (e *SystemUserOrganizationRepository) SaveMany(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, items []*model.SystemUserOrganization) ([]*model.SystemUserOrganization, error)
func (*SystemUserOrganizationRepository) Search ¶
func (e *SystemUserOrganizationRepository) Search(tx *gorm.DB, searchParams *SystemUserOrganizationSearch) ([]*model.SystemUserOrganization, error)
func (*SystemUserOrganizationRepository) Update ¶
func (e *SystemUserOrganizationRepository) Update(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, item *model.SystemUserOrganization) (*model.SystemUserOrganization, error)
func (*SystemUserOrganizationRepository) UpdateMany ¶
func (e *SystemUserOrganizationRepository) UpdateMany(tx *gorm.DB, filterContext *SystemUserOrganizationSearch, items []*model.SystemUserOrganization) ([]*model.SystemUserOrganization, error)
type SystemUserRepo ¶
type SystemUserRepo struct {
// contains filtered or unexported fields
}
func NewSystemUserRepo ¶
func NewSystemUserRepo(db *gorm.DB) *SystemUserRepo
func (*SystemUserRepo) Delete ¶
func (m *SystemUserRepo) Delete(item *model.SystemUser) error
func (*SystemUserRepo) FindById ¶
func (m *SystemUserRepo) FindById(userId uuid.UUID) (*model.SystemUser, error)
func (*SystemUserRepo) FindByUserName ¶
func (m *SystemUserRepo) FindByUserName(userName string) (*model.SystemUser, error)
func (*SystemUserRepo) Save ¶
func (m *SystemUserRepo) Save(item *model.SystemUser) error
Click to show internal directories.
Click to hide internal directories.