logModel

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountLog

type AccountLog[T AccountLogDataRecordable] struct {
	BaseAccountLog `gorm:"embedded"`
	Data           T `gorm:"type:json"`
}

账本

type AccountLogDao

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

func NewDao

func NewDao(db ...*gorm.DB) *AccountLogDao

func (*AccountLogDao) RecordAccountLogMapping

func (d *AccountLogDao) RecordAccountLogMapping(logModel AccountLogger) (AccountLogMapping, error)

type AccountLogDataProvider

type AccountLogDataProvider interface {
	GetLogDataModel() AccountLogDataRecordable
}

type AccountLogDataRecordable

type AccountLogDataRecordable interface {
	Record(baseLog BaseAccountLog, tx *gorm.DB) (AccountLogger, error)
}

type AccountLogMapping

type AccountLogMapping struct {
	ID        uint `gorm:"primarykey"`
	AccountId uint `gorm:"index:idx_account_id"`
	LogTable  string
	LogId     uint
	CreatedAt time.Time      `gorm:"type:TIMESTAMP"`
	UpdatedAt time.Time      `gorm:"type:TIMESTAMP"`
	DeletedAt gorm.DeletedAt `gorm:"index;type:TIMESTAMP"`
}

func (*AccountLogMapping) TableName

func (a *AccountLogMapping) TableName() string

type AccountLogger

type AccountLogger interface {
	TableName() string
	GetId() uint
	GetAccountId() uint
	RecordMapping(tx *gorm.DB) (AccountLogMapping, error)
}

type AccountMappingLog

type AccountMappingLog struct {
	BaseAccountLog `gorm:"embedded"`
	Data           AccountMappingLogData `gorm:"embedded;embeddedPrefix:data_"`
}

func (*AccountMappingLog) RecordMapping

func (a *AccountMappingLog) RecordMapping(tx *gorm.DB) (AccountLogMapping, error)

func (*AccountMappingLog) TableName

func (a *AccountMappingLog) TableName() string

type AccountMappingLogData

type AccountMappingLogData struct {
	MainId    uint
	RelatedId uint
}

func (*AccountMappingLogData) Record

func (m *AccountMappingLogData) Record(baseLog BaseAccountLog, tx *gorm.DB) (AccountLogger, error)

type BaseAccountLog

type BaseAccountLog struct {
	ID        uint                  `gorm:"primarykey"`
	UserId    uint                  `gorm:"index:idx_user_id;not null"`
	AccountId uint                  `gorm:"index:idx_account_id;not null"`
	Operation constant.LogOperation `gorm:"not null"`
}

func (*BaseAccountLog) GetAccountId

func (b *BaseAccountLog) GetAccountId() uint

func (*BaseAccountLog) GetId

func (b *BaseAccountLog) GetId() uint

Jump to

Keyboard shortcuts

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