model

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package model Time : 2023/9/24 16:17 Author : xushiyin contact : yuqingxushiyin@gmail.com

Package model Time : 2023/9/24 17:07 Author : xushiyin contact : yuqingxushiyin@gmail.com

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

DB database singleton

Functions

func Database

func Database(connStr string) error

Database init database instance

Types

type BaseModel added in v0.17.4

type BaseModel struct {
	ID        uint           `gorm:"primaryKey,autoIncrement,not null"` // primary key
	CreatedAt time.Time      `gorm:"autoCreateTime,not null"`           // 创建时间
	UpdatedAt time.Time      `gorm:"autoUpdateTime,not null"`           // 更新时间
	DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`                    //
}

type JwtBlack added in v0.17.4

type JwtBlack struct {
	BaseModel
	Jwt string `gorm:"type:text;comment:jwt"`
}

type SrvUser added in v0.17.4

type SrvUser struct {
	BaseModel
	Uuid     uuid.UUID `json:"uuid" gorm:"index;comment:用户UUID"`                // 用户UUID
	Username string    `json:"username" gorm:"index;comment:用户登录名"`             // 用户登录名
	Password string    `json:"-"  gorm:"comment:用户登录密码"`                        // 用户登录密码
	Nickname string    `json:"nickname" gorm:"default:系统用户;comment:用户昵称"`       // 用户昵称
	Avatar   string    `json:"avatar" gorm:"default:;size:1000;comment:用户头像"`   // 用户头像
	Phone    string    `json:"phone"  gorm:"comment:用户手机号"`                     // 用户手机号
	Email    string    `json:"email"  gorm:"comment:用户邮箱"`                      // 用户邮箱
	Status   int       `json:"status" gorm:"default:1;comment:用户是否被冻结 1正常 2冻结"` // 用户是否被冻结 1正常 2冻结
}

func (SrvUser) TableName added in v0.17.4

func (SrvUser) TableName() string

Directories

Path Synopsis
common

Jump to

Keyboard shortcuts

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