Documentation ¶
Index ¶
- Variables
- type BaseService
- func (svc *BaseService) Exists(db *gorm.DB, modelOrTable any, exist *bool, where string, args ...any) error
- func (svc *BaseService) GetFieldValue(db *gorm.DB, modelOrTable any, field string, id any, where string, args ...any) error
- func (svc *BaseService) GetFieldValues(db *gorm.DB, modelOrTable any, field string, where string, args ...any) (values []any, err error)
- func (svc *BaseService) GetTable(db *gorm.DB, modelOrTable any) (*gorm.DB, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCheckExistsError = errors.New("BaseService.Exists方法调用出错")
View Source
var ErrModelOrTableParamValid = errors.New("BaseService.GetTable参数modelOrTable只支持schema.Tabler和string类型")
View Source
var ErrRecordNotFound = errors.New("记录不存在")
Functions ¶
This section is empty.
Types ¶
type BaseService ¶
type BaseService struct { }
func (*BaseService) Exists ¶
func (svc *BaseService) Exists(db *gorm.DB, modelOrTable any, exist *bool, where string, args ...any) error
Exists 检查数据是否存在
func (*BaseService) GetFieldValue ¶
func (*BaseService) GetFieldValues ¶
Click to show internal directories.
Click to hide internal directories.