base

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseViewModel

type BaseViewModel struct {
}

func (*BaseViewModel) ToDBModel

func (m *BaseViewModel) ToDBModel() (err error)

func (*BaseViewModel) ToViewModel

func (m *BaseViewModel) ToViewModel() (err error)

type ICRUDRepository

type ICRUDRepository[T IDBModel] interface {
	Add(entity T, ctx context.Context, transId string) (err error)
	DelByIds(ids []string, ctx context.Context, transId string) (err error)
	Edit(entity T, ctx context.Context, transId string) (err error)
	Updates(id string, fieldValues map[string]interface{}, ctx context.Context, transId string) (err error)
	GetAll() (result []T, err error)
	GetById(id string) (result T, err error)
	GetByIds(ids []string) (result []T, err error)
	GetByCondition(condition map[string]pkg.SearchCondition) (result []T, total int64, err error)
	Commit(transId string) (err error)
	Rollback(transId string) (err error)
}

type ICRUDUsecase

type ICRUDUsecase[T IDBModel] interface {
	Add(entity T, ctx context.Context, transId string) (err error)
	DelByIds(ids []string, ctx context.Context, transId string) (err error)
	Edit(entity T, ctx context.Context, transId string) (err error)
	Updates(id string, fieldValues map[string]interface{}, ctx context.Context, transId string) (err error)
	GetAll() (result []T, err error)
	GetById(id string) (result T, err error)
	GetByIds(ids []string) (result []T, err error)
	GetByCondition(condition map[string]pkg.SearchCondition) (result []T, total int64, err error)
	Commit(transId string) (err error)
	Rollback(transId string) (err error)
}

type IDBModel

type IDBModel interface {
	TableName() string
	ModelName() string
}

type IViewModel

type IViewModel interface {
	ToDBModel() error
	ToViewModel() error
}

Jump to

Keyboard shortcuts

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