models

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 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 Link struct {
	gorm.Model
	LongUrl   string `json:"longurl" gorm:"not null"`
	ShortUrl  string `json:"shorturl" gorm:"type:varchar(75);not null"`
	Keyword   string `json:"-" gorm:"type:varchar(75);not null"`
	ViewCount int    `json:"view_count" gorm:"not null;default:0"`
	UserID    string `json:"-" gorm:"type:varchar(75);not null;index"`
}

type User

type User struct {
	gorm.Model
	ID       uuid.UUID `json:"id" gorm:"type:varchar(50);primary_key;default:(UUID())"`
	Email    string    `json:"email" gorm:"type:varchar(150);index;unique;not null" form:"email" binding:"required"`
	IsActive bool      `json:"is_active" gorm:"not null;default:false"`
	Password string    `json:"-" gorm:"type:varchar(150);not null" form:"password" binding:"required"`
	Links    []Link    `json:"links" gorm:"ForeignKey:UserID"`
}

Jump to

Keyboard shortcuts

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