entity

package
v0.0.0-...-5614660 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID        int       `gorm:"primaryKey" json:"id"`
	Type      string    `json:"type" gorm:"type:varchar(255);not null"`
	UserID    int       `json:"user_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type CategoryData

type CategoryData struct {
	ID    int    `json:"id"`
	Type  string `json:"type"`
	Tasks []Task `json:"tasks"`
}

func DataToCategoryData

func DataToCategoryData(categories []Category, tasks []Task) []CategoryData

type CategoryRequest

type CategoryRequest struct {
	Type string `json:"type" binding:"required"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

func NewErrorResponse

func NewErrorResponse(msg string) ErrorResponse

type Task

type Task struct {
	ID          int       `gorm:"primaryKey" json:"id"`
	Title       string    `json:"title" gorm:"type:varchar(255);not null"`
	Description string    `json:"description" gorm:"type:text;not null"`
	CategoryID  int       `json:"category_id" gorm:"type:int;not null"`
	UserID      int       `json:"user_id" gorm:"type:int;not null"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	DeletedAt   time.Time `json:"deleted_at"`
}

type TaskCategoryRequest

type TaskCategoryRequest struct {
	ID         int `json:"id"`
	CategoryID int `json:"category_id" binding:"required"`
}

type TaskRequest

type TaskRequest struct {
	ID          int    `json:"id"`
	Title       string `json:"title" binding:"required"`
	Description string `json:"description" binding:"required"`
	CategoryID  int    `json:"category_id"`
}

type User

type User struct {
	ID        int       `gorm:"primaryKey" json:"id"`
	Fullname  string    `json:"fullname" gorm:"type:varchar(255);not null"`
	Email     string    `json:"email" gorm:"type:varchar(255);not null"`
	Password  string    `json:"-" gorm:"type:varchar(255);not null"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type UserLogin

type UserLogin struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type UserRegister

type UserRegister struct {
	Fullname string `json:"fullname" binding:"required"`
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

Jump to

Keyboard shortcuts

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