repository

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module exports dependency

Functions

func QeuryPage

func QeuryPage(db *gorm.DB, pp dto.PaginationParam, out interface{}) (n int64, err error)

func QueryCount

func QueryCount(db *gorm.DB) (n int64, err error)

func QueryOne

func QueryOne(db *gorm.DB, out interface{}) (bool, error)

func QueryPagination

func QueryPagination(db *gorm.DB, pp dto.PaginationParam, out interface{}) (*dto.Pagination, error)

Types

type RoleMenuRepository

type RoleMenuRepository struct {
	// contains filtered or unexported fields
}

RoleMenuRepository database structure

func NewRoleMenuRepository

func NewRoleMenuRepository(db lib.Database, logger lib.Logger) RoleMenuRepository

NewRoleMenuRepository creates a new role menu repository

func (RoleMenuRepository) Create

func (a RoleMenuRepository) Create(roleMenu *models.RoleMenu) error

func (RoleMenuRepository) Delete

func (a RoleMenuRepository) Delete(id string) error

func (RoleMenuRepository) DeleteByRoleID

func (a RoleMenuRepository) DeleteByRoleID(id string) error

func (RoleMenuRepository) Get

func (RoleMenuRepository) Query

func (RoleMenuRepository) Update

func (a RoleMenuRepository) Update(id string, roleMenu *models.RoleMenu) error

func (RoleMenuRepository) WithTrx

func (a RoleMenuRepository) WithTrx(trxHandle *gorm.DB) RoleMenuRepository

WithTrx enables repository with transaction

type RoleRepository

type RoleRepository struct {
	// contains filtered or unexported fields
}

RoleRepository database structure

func NewRoleRepository

func NewRoleRepository(db lib.Database, logger lib.Logger) RoleRepository

NewRoleRepository creates a new role repository

func (RoleRepository) Create

func (a RoleRepository) Create(role *models.Role) error

func (RoleRepository) Delete

func (a RoleRepository) Delete(id string) error

func (RoleRepository) Get

func (a RoleRepository) Get(id string) (*models.Role, error)

func (RoleRepository) Query

func (RoleRepository) Update

func (a RoleRepository) Update(id string, role *models.Role) error

func (RoleRepository) UpdateStatus

func (a RoleRepository) UpdateStatus(id string, status int) error

func (RoleRepository) WithTrx

func (a RoleRepository) WithTrx(trxHandle *gorm.DB) RoleRepository

WithTrx enables repository with transaction

type UserRepository

type UserRepository struct {
	// contains filtered or unexported fields
}

UserRepository database structure

func NewUserRepository

func NewUserRepository(db lib.Database, logger lib.Logger) UserRepository

NewUserRepository creates a new user repository

func (UserRepository) Create

func (a UserRepository) Create(user *models.User) error

func (UserRepository) Delete

func (a UserRepository) Delete(id string) error

func (UserRepository) Get

func (a UserRepository) Get(id string) (*models.User, error)

func (UserRepository) Query

GetAll gets all users

func (UserRepository) Update

func (a UserRepository) Update(id string, user *models.User) error

func (UserRepository) UpdatePassword

func (a UserRepository) UpdatePassword(id, password string) error

func (UserRepository) UpdateStatus

func (a UserRepository) UpdateStatus(id string, status int) error

func (UserRepository) WithTrx

func (a UserRepository) WithTrx(trxHandle *gorm.DB) UserRepository

WithTrx enables repository with transaction

type UserRoleRepository

type UserRoleRepository struct {
	// contains filtered or unexported fields
}

UserRoleRepository database structure

func NewUserRoleRepository

func NewUserRoleRepository(db lib.Database, logger lib.Logger) UserRoleRepository

NewUserRepository creates a new user role repository

func (UserRoleRepository) Create

func (a UserRoleRepository) Create(userRole *models.UserRole) error

func (UserRoleRepository) Delete

func (a UserRoleRepository) Delete(id string) error

func (UserRoleRepository) DeleteByUserID

func (a UserRoleRepository) DeleteByUserID(userID string) error

func (UserRoleRepository) Get

func (UserRoleRepository) Query

func (UserRoleRepository) Update

func (a UserRoleRepository) Update(id string, userRole *models.UserRole) error

func (UserRoleRepository) WithTrx

func (a UserRoleRepository) WithTrx(trxHandle *gorm.DB) UserRoleRepository

WithTrx enables repository with transaction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL