model

package
v0.0.0-...-061a1bd Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 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 Entity

type Entity interface {
	WithIDSet(string) Entity
	GetID() string
}

type Message

type Message struct {
	ID   string `json:"id"`
	Body string `json:"body"`
}

type TodoItem

type TodoItem struct {
	ID          string    `json:"id" gorm:"type:uuid;default:uuid_generate_v4();primarykey"`
	Description string    `json:"description"`
	DueDate     time.Time `json:"dueDate"`
	FileName    string    `json:"fileName"`

	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

NOTE : as "D" principal of SOLID, abstraction must not has any dependency to technology or low/hig level modules. but for simplicity and also using generic repo layer, gorm tags has been applied in the service model.

func (TodoItem) GetID

func (ti TodoItem) GetID() string

func (TodoItem) WithIDSet

func (ti TodoItem) WithIDSet(id string) Entity

Jump to

Keyboard shortcuts

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