dao

package
v0.0.0-...-5a8f76e Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 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 PGRecordDAO

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

func (PGRecordDAO) Create

func (o PGRecordDAO) Create(record *Record) error

func (PGRecordDAO) GetByUser

func (o PGRecordDAO) GetByUser(userID string, date time.Time) (*Record, error)

func (PGRecordDAO) ListByDate

func (o PGRecordDAO) ListByDate(date time.Time) (*[]Record, error)

type Record

type Record struct {
	ID        uint `gorm:"primarykey"`
	UserID    string
	WorkDate  time.Time
	WorkedAt  time.Time `gorm:"autoCreateTime"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type RecordDAO

type RecordDAO interface {
	GetByUser(userID string, date time.Time) (*Record, error)
	ListByDate(date time.Time) (*[]Record, error)
	Create(record *Record) error
}

func NewPGRecordDAO

func NewPGRecordDAO(db *gorm.DB) RecordDAO

Jump to

Keyboard shortcuts

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