domain

package
v0.0.0-...-a91d183 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Todo

type Todo struct {
	ID        int       `gorm:"primaryKey" json:"id,omitempty"`
	Title     string    `json:"title" valid:"required~title is required"`
	Completed bool      `json:"completed"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

Todo represent the model for an todo

func (*Todo) Validate

func (todo *Todo) Validate() utils.Error

type TodoCreate

type TodoCreate struct {
	Title     string `json:"title" valid:"required~title is required"`
	Completed bool   `json:"completed"`
}

TodoRequest defines the request structure for creating or updating a Todo.

type TodoUpdate

type TodoUpdate struct {
	Title     string `json:"title" valid:"required~title is required"`
	Completed bool   `json:"completed"`
}

Jump to

Keyboard shortcuts

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