xdist

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause-Clear Imports: 3 Imported by: 0

Documentation

Overview

数据库存储数据

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetName

func GetName(value, group string) string

获取字典信息

value	字典的value值
group	字典的所属分组

func GetValue

func GetValue(name, group string) string

获取字典信息

name	字典的name名称
group	字典的所属分组

func GroupNV

func GroupNV(group string) (map[string]string, error)

获取分组列表[name => value]

group	待获取的分组下标

func GroupVN

func GroupVN(group string) (map[string]string, error)

获取分组列表[value => name]

group	待获取的分组下标

func Regedit

func Regedit(c *Config)

func SetValue

func SetValue(name, group, value string) error

设置字典下标表示

name	设置的name名称
group	所属分组
value	需要存储的值

Types

type Config

type Config struct {
	DB        *gorm.DB // 数据库连接
	DistTable string   // 字典配置表名
	// contains filtered or unexported fields
}

配置信息

type DistInfo

type DistInfo struct {
	Id        uint   `gorm:"column:id;type:int unsigned;primaryKey;autoIncrement;not null" form:"id" json:"id" xml:"id"`
	Groups    string `gorm:"column:groups;type:varchar(100);comment:所属分组" form:"groups" json:"groups" xml:"groups"`             // 所属分组
	Name      string `gorm:"column:name;type:varchar(100);comment:下标名称" form:"name" json:"name" xml:"name"`                     // 下标名称
	Value     string `gorm:"column:value;type:varchar(300);comment:存储值" form:"value" json:"value" xml:"value"`                  // 存储的值
	CreatedAt string `gorm:"column:created_at;type:datetime;comment:添加时间" form:"created_at" json:"created_at" xml:"created_at"` // 添加时间
}

字典表结构信息

func (*DistInfo) TableName

func (c *DistInfo) TableName() string

Jump to

Keyboard shortcuts

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