model

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDBModel

type BaseDBModel struct {
	Id         int64 `json:"id"`
	CreateTime int64 `gorm:"type:bigint" json:"creatTime,omitempty"`
	UpdateTime int64 `gorm:"type:bigint" json:"updateTime,omitempty"`
}

func (*BaseDBModel) BeforeCreate

func (base *BaseDBModel) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate 在创建记录之前设置 CreateTime 和 UpdateTime

func (*BaseDBModel) BeforeUpdate

func (base *BaseDBModel) BeforeUpdate(tx *gorm.DB) (err error)

BeforeUpdate 在更新记录之前设置 UpdateTime

type DBConfig

type DBConfig struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	DBName   string `yaml:"db-name"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

Jump to

Keyboard shortcuts

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