model

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WaitingNotification    = "等待通知"
	SuccessfulNotification = "成功通知"
	UnboundPhone           = "未绑定电话"
	SmsAPIError            = "短信API错误"
)

Status字段的值

Variables

View Source
var DB *gorm.DB

DB 数据库链接单例

Functions

func ConnectMysql added in v0.2.1

func ConnectMysql(connString string) error

func ExistUserByUniqueField added in v0.2.1

func ExistUserByUniqueField(field, value string) (bool, error)

Types

type Card added in v0.2.0

type Card struct {
	gorm.Model
	Registrant string
	RealName   string
	Sex        string
	College    string
	Number     string `gorm:"unique_index;not null"`
	Location   string
	Status     string
}

type User

type User struct {
	gorm.Model
	NickName  string `gorm:"unique_index;not null"`
	Password  string
	Email     *string `gorm:"unique_index"`
	Telephone *string `gorm:"unique_index"`
	College   string
	Major     string
	ClassName string
	Number    *string `gorm:"unique_index"` // 学号或职工号
	RealName  string
}

Jump to

Keyboard shortcuts

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