db

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Db *gorm.DB
)

Functions

func DictInit

func DictInit()

func DictStr

func DictStr(db *gorm.DB)

func GetDict

func GetDict(key string) map[string]string

根据字典编码获取字典

func GormInit

func GormInit(host, user, pass, name string) *gorm.DB

func SetDict

func SetDict(key string, data map[string]string)

func UpdateDict

func UpdateDict(key string)

更新字典

func VerifyOnly

func VerifyOnly(tablename string, id string, where map[string]interface{}) bool

检测唯一

Types

type SysDictList

type SysDictList struct {
	ID         string `gorm:"primary_key" json:"id"  form:"id"` //
	ParentId   string `json:"parentId" form:"parentId"`         //
	ParentName string `json:"parentName" form:"code"`           //字典名称
	Name       string `json:"name" gorm:"column:name"`
	Value      string `json:"value" gorm:"column:value"`
	Status     int    `json:"status"`   //1正常,2停用,10已删除
	Sort       int    `json:"sort"`     //排序
	Type       int    `json:"type"`     //1自定义 2 数据表
	TableKey   string `json:"tableKey"` //数据表主键
	TableVal   string `json:"tableVal"` //数据包值
}

Jump to

Keyboard shortcuts

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