appRepository

package
v0.0.0-...-e9ec6a3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRepository

type BaseRepository struct {
	Db    *gorm.DB
	Model interface{}
}

func NewRepository

func NewRepository(db *gorm.DB, model interface{}) *BaseRepository

func (*BaseRepository) BeginTransaction

func (r *BaseRepository) BeginTransaction() *gorm.DB

func (*BaseRepository) Count

func (r *BaseRepository) Count() (int64, error)

func (*BaseRepository) Create

func (r *BaseRepository) Create(data interface{}) error

func (*BaseRepository) CreateWithTransaction

func (r *BaseRepository) CreateWithTransaction(tx *gorm.DB, data interface{}) error

func (*BaseRepository) Delete

func (r *BaseRepository) Delete(field, value string) error

func (*BaseRepository) DeleteWithTransaction

func (r *BaseRepository) DeleteWithTransaction(tx *gorm.DB, field, value string) error

func (*BaseRepository) FindAll

func (r *BaseRepository) FindAll(dto interface{}, results interface{}, preloads ...string) (int64, error)

func (*BaseRepository) FindOneByField

func (r *BaseRepository) FindOneByField(field string, value interface{}, preloads ...string) (interface{}, error)

func (*BaseRepository) Update

func (r *BaseRepository) Update(data interface{}) error

func (*BaseRepository) UpdateWithTransaction

func (r *BaseRepository) UpdateWithTransaction(tx *gorm.DB, data interface{}) error

Jump to

Keyboard shortcuts

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