models

package
v0.0.0-...-7220c8d Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	Id           int       `gorm:"type:int;primaryKey;autoIncrement" json:"id"`
	UserId       int       `gorm:"int" json:"userId"`
	Title        string    `gorm:"type:varchar(255)" json:"title"`
	Description  string    `gorm:"type:text" json:"description"`
	Status       string    `gorm:"type:varchar(50)" json:"status"`
	Reason       string    `gorm:"type:text; default:" json:"reason"`
	Revision     string    `gorm:"int; default:0" json:"revision"`
	DueDate      string    `gorm:"type:varchar(50)" json:"dueDate"`
	SubmitDate   string    `gorm:"type:varchar(50)" json:"submitDate"`
	RejectedDate string    `gorm:"type:varchar(50)" json:"rejectDate"`
	ApprovedDate string    `gorm:"type:varchar(50)" json:"approvedDate"`
	Attachment   string    `gorm:"type:varchar(255)" json:"attachment"`
	CreatedAt    time.Time `json:"createdAt"`
	UpdatedAt    time.Time `json:"updatedAt"`
	User         User      `gorm:"foreignKey:UserId" json:"user,omitempty"`
}

type User

type User struct {
	Id        int       `gorm:"type:int;primaryKey;autoIncrement" json:"id"`
	Role      string    `gorm:"type:varchar(10)" json:"role,omitempty"`
	Name      string    `gorm:"type:varchar(255)" json:"name"`
	Email     string    `gorm:"type:varchar(50)" json:"email,omitempty"`
	Password  string    `gorm:"type:varchar(255)" json:"password,omitempty"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Task      []Task    `gorm:"constraint:OnDelete:CASCADE" json:"tasks,omitempty"`
}

func (*User) AfterDelete

func (u *User) AfterDelete(tx *gorm.DB) (err error)

Jump to

Keyboard shortcuts

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