model

package
v0.0.0-...-59d6697 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PassWordCost = 12
)

Variables

View Source
var DB *gorm.DB

Functions

func Database

func Database(connStr string)

Types

type Task

type Task struct {
	gorm.Model
	User      User   `gorm:"ForeignKey:user;AssociationForeignKey:ID"`
	Uid       uint   `gorm:"not null"`
	Title     string `gorm:"index;not null"`
	Status    int    `gorm:"default:'0'"`
	Content   string `gorm:"type:longtext"`
	StartTime int64
	EndTime   int64 `gorm:"default:'0'"`
}

type User

type User struct {
	gorm.Model
	UserName       string `gorm:"unique"`
	PasswordDigest string
}

func (*User) CheckPassword

func (u *User) CheckPassword(password string) bool

func (*User) SetPassword

func (u *User) SetPassword(password string) error

Jump to

Keyboard shortcuts

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