models

package
v0.0.0-...-3b1d222 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateUser

func UpdateUser(user *User) bool

Types

type Good

type Good struct {
	GID  uint64 `json:"gid" gorm:"column:GID;primary_key;auto_increment;not_null"`
	Name string `json:"name"`
}

type Referral

type Referral struct {
	gorm.Model

	RID   uint64 `json:"rid" gorm:"primary_key;auto_increment;not_null"`
	Code  string `json:"code"`
	Count uint64 `json:"count"`
}

type User

type User struct {
	gorm.Model

	UID      uint64 `json:"uid" gorm:"primary_key;auto_increment;not_null"`
	Email    string `json:"email" gorm:"unique;"`
	UserName string `json:"user_name" gorm:"unique;"`
	RCode    string `gorm:"foreignKey:Referral" json:"r_code"`
	Verified bool   `json:"verified"`
}

func CreateUser

func CreateUser(registerReg *app.RegisterRequest) *User

func FindUserByEmail

func FindUserByEmail(email string) *User

func FindUserByUsername

func FindUserByUsername(username string) *User

type Voucher

type Voucher struct {
	gorm.Model

	VID  uint64 `json:"vid" gorm:"primary_key;auto_increment;not_null"`
	Code string `json:"code"`
	UID  uint64 `json:"uid" gorm:"foreignKey:User"`
	GID  uint64 `json:"gid" gorm:"foreignKey:Good"`
}

Jump to

Keyboard shortcuts

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