model

package
v0.0.0-...-66b41b3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDB

func ConnectDB(connectLink string) error

Types

type Bill

type Bill struct {
	gorm.Model
	UserId        uint               `gorm:"not null"`
	ActionTime    time.Time          `gorm:"not null"`
	BillTypeCode  constants.BillType `gorm:"not null"`
	BillAccountId uint               `gorm:"not null"`
	BillTagId     uint               `gorm:"not null"`
	Amount        int                `gorm:"not null"`
	Remarks       string             `gorm:""`
	IsIgnore      bool               `gorm:"not null;default 0"`
}

type BillAccount

type BillAccount struct {
	gorm.Model
	UserId              uint                      `gorm:"not null"`
	BillAccountTypeCode constants.BillAccountType `gorm:"not null"`
	Name                string                    `gorm:"not null"`
	Amount              int                       `gorm:"not null"`
	Remarks             string
}

type BillTag

type BillTag struct {
	gorm.Model
	UserId       uint               `gorm:"not null"`
	BillTypeCode constants.BillType `gorm:"not null"`
	Name         string             `gorm:"not null"`
	Icon         string             `gorm:""`
	Order        uint               `gorm:""`
}

type KeyVal

type KeyVal struct {
	gorm.Model
	Key       string    `gorm:"not null"`
	Val       string    `gorm:""`
	ExpiredAt time.Time `gorm:""`
}

type User

type User struct {
	gorm.Model
	Name     string `gorm:"unique_index;not null"`
	Password string `gorm:"not null"`
	Slat     string `gorm:"not null"`
	Email    string `gorm:"not null"`
	Mobile   string `gorm:"not null"`
	IsLocked bool   `gorm:"not null;default:false"`
	IsActive bool   `gorm:"not null;default:true"`
}

type UserOauth

type UserOauth struct {
	gorm.Model
	UserId uint                `gorm:"not null"`
	Type   constants.OauthType `gorm:"not null"`
	Code   string              `gorm:"not null"`
}

Jump to

Keyboard shortcuts

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