model

package
v0.2.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDB

func ConnectDB() *gorm.DB

Types

type BaseModel

type BaseModel struct {
	ID        uint64    `gorm:"column:id;primaryKey;autoIncrement;not null"`
	CreatedAt time.Time `gorm:"column:created_at;index"`
	UpdatedAt time.Time `gorm:"column:updated_at;index"`
}

BaseModel 主模型

func (BaseModel) CreatedAtDate

func (model BaseModel) CreatedAtDate() string

CreatedAtDate 获取创建时间

func (BaseModel) GetStringID

func (model BaseModel) GetStringID() string

GetStringID 获取主键字符串

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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