initdata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DBNullErr   = errors.New("缺少数据库实例")
	InitDataErr = errors.New("初始化数据失败")
)

Functions

func InitData

func InitData(db *gorm.DB)

InitData @description: 对数据库表和表数据进行初始化 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/10/31 23:45 @success:

Types

type InitCategory

type InitCategory struct {
}

func (InitCategory) DataInserted

func (i InitCategory) DataInserted(db *gorm.DB) bool

DataInserted @description: 数据是否已插入 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/10/31 18:19 @success:

func (InitCategory) InitializeData

func (i InitCategory) InitializeData(db *gorm.DB) (err error)

InitializeData @description: 初始化数据 @param: @author: GJing @email: gjing1st@gmail.com @date: 2022/10/31 17:26 @success:

type InitTable

type InitTable interface {
	DataInserted(*gorm.DB) bool          //表数据是否已经插入
	InitializeData(*gorm.DB) (err error) //初始化表数据
}

Jump to

Keyboard shortcuts

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