model

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package model vtb数据库操作

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FirstCategory

type FirstCategory struct {
	gorm.Model
	FirstCategoryIndex       int64  `gorm:"column:first_category_index"`
	FirstCategoryName        string `gorm:"column:first_category_name"`
	FirstCategoryUID         string `gorm:"column:first_category_uid"`
	FirstCategoryDescription string `gorm:"column:first_category_description;type:varchar(1024)"`
	FirstCategoryIconPath    string `gorm:"column:first_category_icon_path"`
}

FirstCategory 第一品类

func (FirstCategory) TableName

func (FirstCategory) TableName() string

TableName ...

type SecondCategory

type SecondCategory struct {
	gorm.Model
	SecondCategoryIndex       int64  `gorm:"column:second_category_index"`
	FirstCategoryUID          string `gorm:"column:first_category_uid;association_foreignkey:first_category_uid"`
	SecondCategoryName        string `gorm:"column:second_category_name"`
	SecondCategoryAuthor      string `gorm:"column:second_category_author"`
	SecondCategoryDescription string `gorm:"column:second_category_description"`
}

SecondCategory 第二品类

func (SecondCategory) TableName

func (SecondCategory) TableName() string

TableName ...

type ThirdCategory

type ThirdCategory struct {
	gorm.Model
	ThirdCategoryIndex       int64  `gorm:"column:third_category_index"`
	SecondCategoryIndex      int64  `gorm:"column:second_category_index"`
	FirstCategoryUID         string `gorm:"column:first_category_uid"`
	ThirdCategoryName        string `gorm:"column:third_category_name"`
	ThirdCategoryPath        string `gorm:"column:third_category_path"`
	ThirdCategoryAuthor      string `gorm:"column:third_category_author"`
	ThirdCategoryDescription string `gorm:"column:third_category_description"`
}

ThirdCategory 第三品类

func (ThirdCategory) TableName

func (ThirdCategory) TableName() string

TableName ...

type VtbDB

type VtbDB gorm.DB

VtbDB vtb 数据库

func Initialize

func Initialize(dbpath string) *VtbDB

Initialize ...

func Open

func Open(dbpath string) (*VtbDB, error)

Open ...

func (*VtbDB) Close

func (vdb *VtbDB) Close() error

Close ...

func (*VtbDB) GetAllFirstCategoryMessage

func (vdb *VtbDB) GetAllFirstCategoryMessage() (string, error)

GetAllFirstCategoryMessage 取出所有vtb

func (*VtbDB) GetAllSecondCategoryMessageByFirstIndex

func (vdb *VtbDB) GetAllSecondCategoryMessageByFirstIndex(firstIndex int) (string, error)

GetAllSecondCategoryMessageByFirstIndex 取得同一个vtb所有语录类别

func (*VtbDB) GetAllThirdCategoryMessageByFirstIndexAndSecondIndex

func (vdb *VtbDB) GetAllThirdCategoryMessageByFirstIndexAndSecondIndex(firstIndex, secondIndex int) (string, error)

GetAllThirdCategoryMessageByFirstIndexAndSecondIndex 取得同一个vtb同个类别的所有语录

func (*VtbDB) GetFirstCategoryByFirstUID

func (vdb *VtbDB) GetFirstCategoryByFirstUID(firstUID string) FirstCategory

GetFirstCategoryByFirstUID ...

func (*VtbDB) GetThirdCategory

func (vdb *VtbDB) GetThirdCategory(firstIndex, secondIndex, thirdIndex int) ThirdCategory

GetThirdCategory ...

func (*VtbDB) GetVtbList

func (vdb *VtbDB) GetVtbList() (uidList []string, err error)

GetVtbList ...

func (*VtbDB) RandomVtb

func (vdb *VtbDB) RandomVtb() ThirdCategory

RandomVtb ...

func (*VtbDB) StoreVtb

func (vdb *VtbDB) StoreVtb(uid string) (err error)

StoreVtb ...

Jump to

Keyboard shortcuts

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